]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Revert "fire opened.zf.offcanvas after adding the classes to prevent some race condit...
authorDaniel Ruf <daniel.ruf@ueberbit.de>
Wed, 21 Feb 2018 12:12:17 +0000 (13:12 +0100)
committerDaniel Ruf <daniel.ruf@ueberbit.de>
Wed, 21 Feb 2018 12:12:33 +0000 (13:12 +0100)
This reverts commit 58ca2385e966dc5fcd47f41b32b79fed62f2daa3.

js/foundation.offcanvas.js
test/javascript/components/offcanvas.js

index 6c46ce0aa5a698dd29031b807e60f09d867c92cc..a5fb0cf6dda20c89a5ef7c6d8d18101bf04181a3 100644 (file)
@@ -301,11 +301,15 @@ class OffCanvas extends Plugin {
       this.$element.siblings('[data-off-canvas-content]').css('transition-duration', '');
     }
 
+    /**
+     * Fires when the off-canvas menu opens.
+     * @event OffCanvas#opened
+     */
     this.$element.addClass('is-open').removeClass('is-closed');
-    this.$triggers.attr('aria-expanded', 'true');
-    this.$element.attr('aria-hidden', 'false');
-
 
+    this.$triggers.attr('aria-expanded', 'true');
+    this.$element.attr('aria-hidden', 'false')
+        .trigger('opened.zf.offcanvas');
 
     this.$content.addClass('is-open-' + this.position);
 
index d5cace80067e7a4e95c431d2f4dac6b0049072a3..7938dbaf1726f0109d0bf6b87b8240db57d4e75d 100644 (file)
@@ -104,7 +104,7 @@ describe('Off Canvas', function() {
           plugin.$element.should.have.class('is-open');
           $('body').should.have.class('is-off-canvas-open');
           done();
-        }, 1);
+        }, 30);
       });
 
       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');