From 40de42d812e099d7bd273cd7f8f35c436bdce4d1 Mon Sep 17 00:00:00 2001 From: "g.chanaud" Date: Tue, 12 Apr 2016 14:20:21 +0200 Subject: [PATCH] [Bugfix] Drilldown - Cleaning attached events correctly on destroy() call --- js/foundation.drilldown.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/foundation.drilldown.js b/js/foundation.drilldown.js index f716f7efe..b9f67b3e6 100644 --- a/js/foundation.drilldown.js +++ b/js/foundation.drilldown.js @@ -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); -- 2.47.2