Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MINOR Fixed jQuery.jstree men leaks on 'dnd' and 'context menu' plugi…

…ns, by removing globally bound event handlers (see #7258)
  • Loading branch information...
commit 7ba759e77b59846f7c149720f39ed343d22abab7 1 parent 5260738
@chillu chillu authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 thirdparty/jstree/jquery.jstree.js
View
16 thirdparty/jstree/jquery.jstree.js
@@ -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,
Please sign in to comment.
Something went wrong with that request. Please try again.