]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Update foundation.drilldown.js 7604/head
authorEric Jung <eric.jung@getfoxyproxy.org>
Thu, 17 Dec 2015 21:54:45 +0000 (14:54 -0700)
committerEric Jung <eric.jung@getfoxyproxy.org>
Thu, 17 Dec 2015 21:54:45 +0000 (14:54 -0700)
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.

js/foundation.drilldown.js

index 13e42740b9f792e29536ff8857e8570ee4ff7e97..bb0fd9e8ad89e70bc64258d11e3a540c786285ba 100644 (file)
@@ -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();