From 84ca9cdc24763d7292cd8bf3f37fdbca15b5a68c Mon Sep 17 00:00:00 2001 From: Abdullah Almsaeed Date: Sat, 25 Feb 2017 14:45:03 -0500 Subject: [PATCH] Make listeners specific to the element --- build/js/Tree.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/build/js/Tree.js b/build/js/Tree.js index 7b33e1d3c..1e9f0dfb1 100644 --- a/build/js/Tree.js +++ b/build/js/Tree.js @@ -3,7 +3,6 @@ * Converts a nested list into a multilevel * tree view menu. * - * @type Function * @Usage: $('.my-menu').tree(options) * or add [data-widget="tree"] to the ul element * Pass any option as data-option="value" @@ -104,9 +103,7 @@ Tree.prototype._setUpListeners = function () { var that = this - $(document) - .off('click', this.options.trigger) - .on('click', this.options.trigger, function (event) { + $(this.element).on('click', this.options.trigger, function (event) { that.toggle($(this), event) }) } @@ -137,7 +134,6 @@ return this } - // Tree Data API // ============= $(window).on('load', function () {