From: Eric Jung Date: Thu, 17 Dec 2015 21:54:45 +0000 (-0700) Subject: Update foundation.drilldown.js X-Git-Tag: v6.1.0~32^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7604%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Update foundation.drilldown.js If I use one of the visibility classes (http://foundation.zurb.com/sites/docs/visibility.html) to conditionally hide the drilldown, then _getMaxDims() throws an exception during initialization on line 295 when dereferencing the empy this.$menuItems array. That prevent other javascript on the page from executing. This change ensures the array is not empty in such cases, providing of course there are actually li elements in the DOM. --- diff --git a/js/foundation.drilldown.js b/js/foundation.drilldown.js index 13e42740b..bb0fd9e8a 100644 --- a/js/foundation.drilldown.js +++ b/js/foundation.drilldown.js @@ -63,7 +63,7 @@ Drilldown.prototype._init = function(){ this.$submenuAnchors = this.$element.find('li.has-submenu'); this.$submenus = this.$submenuAnchors.children('[data-submenu]'); - this.$menuItems = this.$element.find('li:visible').not('.js-drilldown-back').attr('role', 'menuitem'); + this.$menuItems = this.$element.find('li').not('.js-drilldown-back').attr('role', 'menuitem'); this._prepareMenu();