From 62ed2d0f22ed9d6c2d9e4935a9c3d621abaaed95 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Mon, 28 Jul 2014 13:33:41 +1200 Subject: [PATCH] BUG Fix periodic tinymce layout refresh --- javascript/HtmlEditorField.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/javascript/HtmlEditorField.js b/javascript/HtmlEditorField.js index 93c918366..5b88580e4 100644 --- a/javascript/HtmlEditorField.js +++ b/javascript/HtmlEditorField.js @@ -92,7 +92,12 @@ ss.editorWrappers.tinyMCE = (function() { var interval; jQuery(ed.getBody()).on('focus', function() { interval = setInterval(function() { - ed.save(); + // Update underlying element as necessary + var element = jQuery(ed.getElement()); + if(ed.isDirty()) { + // Set content without triggering editor content cleanup + element.val(ed.getContent({format : 'raw', no_events : 1})); + } }, 5000); }); jQuery(ed.getBody()).on('blur', function() {