From: Kevin Ball Date: Thu, 8 Dec 2016 19:11:10 +0000 (-0800) Subject: Fix missing declaration found while tracking down #9470 X-Git-Tag: v6.3.0-rc3~1^2~5^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9472%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Fix missing declaration found while tracking down #9470 --- diff --git a/js/foundation.dropdownMenu.js b/js/foundation.dropdownMenu.js index 9661315d7..f53e7213d 100644 --- a/js/foundation.dropdownMenu.js +++ b/js/foundation.dropdownMenu.js @@ -101,17 +101,18 @@ class DropdownMenu { if (this.options.clickOpen || hasTouch) { this.$menuItems.on('click.zf.dropdownmenu touchstart.zf.dropdownmenu', handleClickFn); } - + // Handle Leaf element Clicks if(_this.options.closeOnClickInside){ this.$menuItems.on('click.zf.dropdownmenu touchend.zf.dropdownmenu', function(e) { - var hasSub = $elem.hasClass(parClass); + var $elem = $(this), + hasSub = $elem.hasClass(parClass); if(!hasSub){ _this._hide(); } }); } - + if (!this.options.disableHover) { this.$menuItems.on('mouseenter.zf.dropdownmenu', function(e) { var $elem = $(this),