From: Daniel Ruf Date: Wed, 21 Feb 2018 12:26:23 +0000 (+0100) Subject: revert component file and test to initial state X-Git-Tag: v6.6.0~3^2~295^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12ae1a917;p=thirdparty%2Ffoundation%2Ffoundation-sites.git revert component file and test to initial state --- diff --git a/js/foundation.offcanvas.js b/js/foundation.offcanvas.js index 5d14ab9f5..c64cb86b6 100644 --- a/js/foundation.offcanvas.js +++ b/js/foundation.offcanvas.js @@ -327,13 +327,7 @@ class OffCanvas extends Plugin { if (this.options.closeOnClick === true && this.options.contentOverlay === true) { this.$overlay.addClass('is-closable'); } - - /** - * Fires when the off-canvas menu opens. - * @event OffCanvas#opened - */ - this.$element.trigger('opened.zf.offcanvas'); - + if (this.options.autoFocus === true) { this.$element.one(transitionend(this.$element), function() { if (!_this.$element.hasClass('is-open')) { diff --git a/test/javascript/components/offcanvas.js b/test/javascript/components/offcanvas.js index 7938dbaf1..d5cace800 100644 --- a/test/javascript/components/offcanvas.js +++ b/test/javascript/components/offcanvas.js @@ -104,7 +104,7 @@ describe('Off Canvas', function() { plugin.$element.should.have.class('is-open'); $('body').should.have.class('is-off-canvas-open'); done(); - }, 30); + }, 1); }); plugin.open(); @@ -252,7 +252,7 @@ describe('Off Canvas', function() { plugin.toggle(); }); }); - + describe('keyboard events', function() { it('closes Off Canvas on ESCAPE', function(done) { $html = $(template).appendTo('body');