]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
[Bugfix] Drilldown - Cleaning attached events correctly on destroy() call 8583/head
authorg.chanaud <g.chanaud@regence-production.ch>
Tue, 12 Apr 2016 12:20:21 +0000 (14:20 +0200)
committerg.chanaud <g.chanaud@regence-production.ch>
Tue, 12 Apr 2016 12:20:21 +0000 (14:20 +0200)
js/foundation.drilldown.js

index f716f7efe4f720aafa5367fa6f6dc1b0addd2e06..b9f67b3e602e0ba606f6b270f7ff4eb6e80a2b39 100644 (file)
@@ -315,8 +315,10 @@ class Drilldown {
     this.$element.unwrap()
                  .find('.js-drilldown-back, .is-submenu-parent-item').remove()
                  .end().find('.is-active, .is-closing, .is-drilldown-submenu').removeClass('is-active is-closing is-drilldown-submenu')
-                 .end().find('[data-submenu]').removeAttr('aria-hidden tabindex role')
-                 .off('.zf.drilldown').end().off('zf.drilldown');
+                 .end().find('[data-submenu]').removeAttr('aria-hidden tabindex role');
+    this.$submenuAnchors.each(function() {
+      $(this).off('.zf.drilldown');
+    });
     this.$element.find('a').each(function(){
       var $link = $(this);
       if($link.data('savedHref')){
@@ -358,4 +360,4 @@ Drilldown.defaults = {
 // Window exports
 Foundation.plugin(Drilldown, 'Drilldown');
 
-}(jQuery);
\ No newline at end of file
+}(jQuery);