From: g.chanaud Date: Tue, 12 Apr 2016 12:20:21 +0000 (+0200) Subject: [Bugfix] Drilldown - Cleaning attached events correctly on destroy() call X-Git-Tag: v6.2.2-rc1~64^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8583%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git [Bugfix] Drilldown - Cleaning attached events correctly on destroy() call --- 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);