]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fixes issue where drilldowns removed href attributes from anchors, but did not reappl...
authorzurbchris <chris@zurb.com>
Wed, 2 Dec 2015 00:06:19 +0000 (16:06 -0800)
committerzurbchris <chris@zurb.com>
Wed, 2 Dec 2015 00:06:19 +0000 (16:06 -0800)
js/foundation.drilldown.js

index 2c444a8db4b14e83de81ee2d6525f5240417bf8f..488cdda2ac6d38119a977826c7bb800e32d4640f 100644 (file)
@@ -66,7 +66,7 @@
     this.$menuItems = this.$element.find('li:visible').not('.js-drilldown-back').attr('role', 'menuitem');
 
     this._prepareMenu();
-    
+
     this._keyboardEvents();
   };
   /**
@@ -83,7 +83,8 @@
     // }
     this.$submenuAnchors.each(function(){
       var $sub = $(this);
-      $sub.find('a')[0].removeAttribute('href');
+      var $link = $sub.find('a:first');
+      $link.data('savedHref', $link.attr('href')).removeAttr('href');
       $sub.children('[data-submenu]')
           .attr({
             'aria-hidden': true,
                  .end().find('.is-active, .is-closing, .is-drilldown-sub').removeClass('is-active is-closing is-drilldown-sub')
                  .end().find('[data-submenu]').removeAttr('aria-hidden tabindex role')
                  .off('.zf.drilldown').end().off('zf.drilldown');
-
+    this.$element.find('a').each(function(){
+      var $link = $(this);
+      if($link.data('savedHref')){
+        $link.attr('href', $link.data('savedHref')).removeData('savedHref');
+      }else{ return; }
+    });
     Foundation.unregisterPlugin(this);
   };
   Foundation.plugin(Drilldown, 'Drilldown');