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')) {
plugin.$element.should.have.class('is-open');
$('body').should.have.class('is-off-canvas-open');
done();
- }, 30);
+ }, 1);
});
plugin.open();
plugin.toggle();
});
});
-
+
describe('keyboard events', function() {
it('closes Off Canvas on ESCAPE', function(done) {
$html = $(template).appendTo('body');