Merge pull request #4097 from tractorcow/pulls/3.1/fix-tinymce

BUG Fix tinymce errors crashing CMS
This commit is contained in:
Hamish Friedlander 2015-04-24 15:20:40 +12:00
commit b823d2df88

View File

@ -293,8 +293,15 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
onremove: function() {
var ed = tinyMCE.get(this.attr('id'));
if (ed) {
ed.remove();
ed.destroy();
try {
ed.remove();
} catch(ex) {}
try {
ed.destroy();
} catch(ex) {}
// Remove any residual tinyMCE editor element
this.next('.mceEditor').remove();
// TinyMCE leaves behind events. We should really fix TinyMCE, but lets brute force it for now
$.each(jQuery.cache, function(){