From 9a5540934f323ef0f6501eb98ec625d7f2a963a1 Mon Sep 17 00:00:00 2001 From: jk Date: Thu, 14 Apr 2016 00:45:28 +0200 Subject: [PATCH] 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 --- js/foundation.drilldown.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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'); -- 2.47.2