diff --git a/admin/javascript/LeftAndMain.EditForm.js b/admin/javascript/LeftAndMain.EditForm.js index 6afa229a9..37186c57d 100644 --- a/admin/javascript/LeftAndMain.EditForm.js +++ b/admin/javascript/LeftAndMain.EditForm.js @@ -87,13 +87,6 @@ $(this).remove(); }); - // Remove all TinyMCE instances - if((typeof tinymce != 'undefined') && tinymce.editors) { - $(tinymce.editors).each(function() { - if(typeof(this.remove) == 'function') this.remove(); - }); - } - this._super(); }, @@ -212,6 +205,14 @@ var inst = tinyMCE.getInstanceById(this.attr('id')); if (inst) inst.startContent = tinymce.trim(inst.getContent({format : 'raw', no_events : 1})); }; + + this._super(); + }, + + onunmatch: function() { + tinyMCE.execCommand("mceRemoveControl", true, this.attr('id')); + + this._super(); } }); });