Skip to content

Commit

Permalink
MINOR Avoid applying jstree plugin multiple times when onmatch is cal…
Browse files Browse the repository at this point in the history
…led on CSS class changes, rather than DOM insertions
  • Loading branch information
chillu committed Mar 6, 2012
1 parent 0c6bc2f commit 746e3ea
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions admin/javascript/LeftAndMain.Tree.js
Expand Up @@ -12,6 +12,9 @@

onmatch: function() {
this._super();

// Don't reapply (expensive) tree behaviour if already present
if(!$.isNaN(this.data('jstree_instance_id'))) return;

var hints = this.attr('data-hints');
if(hints) this.setHints($.parseJSON(hints));
Expand Down

0 comments on commit 746e3ea

Please sign in to comment.