mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX: TinyMCE isnt unbinding formatselect or styleselect which leaks memory. We should really fix TinyMCE, but lets just brute-force it for now.
This commit is contained in:
parent
e58929d52c
commit
1085fd29be
@ -216,7 +216,21 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
|
|||||||
},
|
},
|
||||||
onremove: function() {
|
onremove: function() {
|
||||||
var ed = tinyMCE.get(this.attr('id'));
|
var ed = tinyMCE.get(this.attr('id'));
|
||||||
if (ed) ed.remove();
|
if (ed) {
|
||||||
|
ed.remove();
|
||||||
|
|
||||||
|
// TinyMCE leaves behind events. We should really fix TinyMCE, but lets brute force it for now
|
||||||
|
$.each(jQuery.cache, function(){
|
||||||
|
var source = this.handle && this.handle.elem;
|
||||||
|
if (!source) return;
|
||||||
|
|
||||||
|
var parent = source;
|
||||||
|
while (parent && parent.nodeType == 1) parent = parent.parentNode;
|
||||||
|
|
||||||
|
if (!parent) $(source).unbind().remove();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
this._super();
|
this._super();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user