CRM-15939 - Fix richTextEditor in contact inline-edit
authorColeman Watts <coleman@civicrm.org>
Tue, 10 Feb 2015 19:15:03 +0000 (14:15 -0500)
committerColeman Watts <coleman@civicrm.org>
Tue, 10 Feb 2015 19:15:03 +0000 (14:15 -0500)
templates/CRM/Contact/Page/View/Summary.js

index 2680b9aa899071e3833ec01597635a38ece7e120..c4ee0beb80324799246d21f8b9589207754a68c2 100644 (file)
@@ -1,11 +1,25 @@
 // http://civicrm.org/licensing
 (function($, _) {
+  // FIXME: Much of this code is redundant with CRM.loadForm
 
   var ajaxFormParams = {
     dataType:'json',
     beforeSubmit: function(arr, $form, options) {
       $form.block();
     },
+    beforeSerialize: function(form, options) {
+      // Copied from crm.ajax.js
+      if (window.CKEDITOR && window.CKEDITOR.instances) {
+        $.each(CKEDITOR.instances, function() {
+          this.updateElement && this.updateElement();
+        });
+      }
+      if (window.tinyMCE && tinyMCE.editors) {
+        $.each(tinyMCE.editors, function() {
+          this.save();
+        });
+      }
+    },
     success: requestHandler,
     error: errorHandler
   };