mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Fixed jQuery.jstree men leaks on 'dnd' and 'context menu' plugins, by removing globally bound event handlers (see #7258)
This commit is contained in:
parent
5260738148
commit
7ba759e77b
16
thirdparty/jstree/jquery.jstree.js
vendored
16
thirdparty/jstree/jquery.jstree.js
vendored
@ -2542,6 +2542,15 @@
|
||||
drag_finish : $.noop,
|
||||
drag_check : function (data) { return { after : false, before : false, inside : true }; }
|
||||
},
|
||||
__destroy : function () {
|
||||
// unbind global event handlers when last instance is removed
|
||||
// (no access to private 'instances' variable from here)
|
||||
if($('.jstree').length <= 1) {
|
||||
$(document)
|
||||
.unbind("drag_start.vakata")
|
||||
.unbind("drag_stop.vakata");
|
||||
}
|
||||
},
|
||||
_fn : {
|
||||
dnd_prepare : function () {
|
||||
if(!r || !r.length) { return; }
|
||||
@ -3719,6 +3728,13 @@
|
||||
}, this));
|
||||
$(document).bind("context_hide.vakata", $.proxy(function () { this.data.contextmenu = false; }, this));
|
||||
},
|
||||
__destroy: function() {
|
||||
// unbind global event handlers when last instance is removed
|
||||
// (no access to private 'instances' variable from here)
|
||||
if($('.jstree').length <= 1) {
|
||||
$(document).unbind("context_hide.vakata");
|
||||
}
|
||||
},
|
||||
defaults : {
|
||||
select_node : false, // requires UI plugin
|
||||
show_at_node : true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user