X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=js%2Fcrm.ajax.js;h=3ea776c4f834190e1cd261bae28f1c509a8a3f9b;hb=00252851362ea1d1373ac5075624c89359b9427c;hp=7c180cd72414371aa3bf301d2ffa54a262e05eb2;hpb=0f0925b04bbab9e936c4bd36c59d67925f68d8c3;p=civicrm-core.git diff --git a/js/crm.ajax.js b/js/crm.ajax.js index 7c180cd724..3ea776c4f8 100644 --- a/js/crm.ajax.js +++ b/js/crm.ajax.js @@ -448,18 +448,6 @@ } } }, - beforeSerialize: function(form, options) { - if (window.CKEDITOR && window.CKEDITOR.instances) { - $.each(CKEDITOR.instances, function() { - if (this.updateElement) this.updateElement(); - }); - } - if (window.tinyMCE && tinyMCE.editors) { - $.each(tinyMCE.editors, function() { - this.save(); - }); - } - }, beforeSubmit: function(submission) { $.each(formErrors, function() { if (this && this.close) this.close(); @@ -596,6 +584,12 @@ .on('dialogcreate', function(e) { $('.ui-dialog-content.crm-ajax-container:hidden[data-unsaved-changes=true]').crmSnippet('destroy').dialog('destroy').remove(); }) + // Ensure wysiwyg content is updated prior to ajax submit + .on('form-pre-serialize', function(e) { + $('.crm-wysiwyg-enabled', e.target).each(function() { + CRM.wysiwyg.updateElement(this); + }); + }) // Auto-resize dialogs when loading content .on('crmLoad dialogopen', 'div.ui-dialog.ui-resizable.crm-container', function(e) { var