From: jk Date: Wed, 13 Apr 2016 22:45:28 +0000 (+0200) Subject: var $body = $('body').not(_this.$wrapper); X-Git-Tag: v6.2.2-rc1~46^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8599%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git var $body = $('body').not(_this.$wrapper); not ignores clicks on links in the drilldown menu fixes links with no sub and closeOnClick true doesn't fire --- diff --git a/js/foundation.drilldown.js b/js/foundation.drilldown.js index b9f67b3e6..f8771cadf 100644 --- a/js/foundation.drilldown.js +++ b/js/foundation.drilldown.js @@ -116,8 +116,9 @@ class Drilldown { _this._show($elem.parent('li')); if(_this.options.closeOnClick){ - var $body = $('body').not(_this.$wrapper); + var $body = $('body'); $body.off('.zf.drilldown').on('click.zf.drilldown', function(e){ + if (e.target === _this.$element[0] || $.contains(_this.$element[0], e.target)) { return; } e.preventDefault(); _this._hideAll(); $body.off('.zf.drilldown');