BUG Fix tinymce errors crashing CMS

When removing a tinymce field, internal third party errors should be caught and ignored gracefully rather than breaking the whole CMS.
This commit is contained in:
Damian Mooyman 2015-04-23 10:08:33 +12:00
parent e0b7bc9cda
commit 19423e9a44

View File

@ -293,8 +293,15 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
onremove: function() {
var ed = tinyMCE.get(this.attr('id'));
if (ed) {
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(){