]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix: fix wrong context when triggering "closed.zf.drilldown" in Drilldown
authorNicolas Coden <nicolas@ncoden.fr>
Tue, 23 Oct 2018 20:44:39 +0000 (22:44 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Tue, 23 Oct 2018 20:44:39 +0000 (22:44 +0200)
When triggering "closed.zf.drilldown", the context `this` should be the component. But jQuery's `.one(...)` change it to `$elem`.

js/foundation.drilldown.js

index 450e27f100a4aa5eaa79e7a703c9936480c401f5..fac611ae8efc9d799d603e7922e5de2da4e2c6ea 100644 (file)
@@ -298,7 +298,7 @@ class Drilldown extends Plugin {
   _hideAll() {
     var $elem = this.$element.find('.is-drilldown-submenu.is-active').addClass('is-closing');
     if(this.options.autoHeight) this.$wrapper.css({height:$elem.parent().closest('ul').data('calcHeight')});
-    $elem.one(transitionend($elem), function(e){
+    $elem.one(transitionend($elem), (e) => {
       $elem.removeClass('is-active is-closing');
          /**
        * Fires when the menu is fully closed.