From: SassNinja Date: Fri, 16 Jun 2017 09:13:20 +0000 (+0200) Subject: Remove the transitionend listener for the content container X-Git-Tag: v6.4.0-rc5~9^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22db1ea413b1aef3a60de2fb17ecdf1cf240f40c;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Remove the transitionend listener for the content container Since the limited version doesn't enable push transitions for nested elements, there's no need to listen on the content because the element always gets moved. --- diff --git a/js/foundation.offcanvas.js b/js/foundation.offcanvas.js index 9d7a90ea8..621a2ff4a 100644 --- a/js/foundation.offcanvas.js +++ b/js/foundation.offcanvas.js @@ -294,7 +294,7 @@ class OffCanvas extends Plugin { * Fires when the off-canvas menu opens. * @event OffCanvas#opened */ - _this.$element.addClass('is-open').removeClass('is-closed'); + this.$element.addClass('is-open').removeClass('is-closed'); this.$triggers.attr('aria-expanded', 'true'); this.$element.attr('aria-hidden', 'false') @@ -350,7 +350,7 @@ class OffCanvas extends Plugin { var _this = this; - _this.$element.removeClass('is-open'); + this.$element.removeClass('is-open'); this.$element.attr('aria-hidden', 'true') /** @@ -383,23 +383,10 @@ class OffCanvas extends Plugin { Keyboard.releaseFocus(this.$element); } - // Listen to transitionEnd and add class when done. - // Listening to both, element and content, is required because they don't always transform together (e.g. on nested push transition). - this.$content.one(Foundation.transitionend(this.$content), function(e) { - if (e.originalEvent.propertyName.match(/transform/i)) { - _this.$element.off(Foundation.transitionend(this.$content)); // unbind $element listener since it hasn't transformed - _this.$element.addClass('is-closed'); - _this.$content.off(Foundation.transitionend(_this.$content)); - _this._removeContentClasses(); - } - }); + // Listen to transitionEnd and add class when done. this.$element.one(Foundation.transitionend(this.$element), function(e) { - if (e.originalEvent.propertyName.match(/transform/i)) { - _this.$content.off(Foundation.transitionend(this.$element)); // unbind $content listener since it hasn't transformed - _this.$element.addClass('is-closed'); - _this.$content.off(Foundation.transitionend(_this.$content)); - _this._removeContentClasses(); - } + _this.$element.addClass('is-closed'); + _this._removeContentClasses(); }); }