diff --git a/javascript/HtmlEditorField.js b/javascript/HtmlEditorField.js index 00febb7b8..df52aef6d 100644 --- a/javascript/HtmlEditorField.js +++ b/javascript/HtmlEditorField.js @@ -290,6 +290,16 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE; this._super(); }, + /** + * Make sure the editor has flushed all it's buffers before the form is submitted. + */ + 'from .cms-edit-form': { + onbeforesubmitform: function(e) { + this.getEditor().save(); + this._super(); + } + }, + oneditorinit: function() { // Delayed show because TinyMCE calls hide() via setTimeout on removing an element, // which is called in quick succession with adding a new editor after ajax loading new markup