plugin.open();
});
+
+ it('fires openedEnd.zf.offCanvas event', function(done) {
+ $html = $(template).appendTo('body');
+ plugin = new Foundation.OffCanvas($html.find('[data-off-canvas]'), {});
+
+ $html.one('opened.zf.offCanvas', function () {
+ $html.one('openedEnd.zf.offCanvas', function () {
+ done();
+ });
+ });
+
+ plugin.open();
+ });
});
describe('close()', function() {
plugin.open();
});
+ it('fires closedEnd.zf.offCanvas event', function(done) {
+ $html = $(template).appendTo('body');
+ plugin = new Foundation.OffCanvas($html.find('[data-off-canvas]'), {});
+
+ $html.one('openedEnd.zf.offCanvas', function() {
+ $html.one('closedEnd.zf.offCanvas', function() {
+ done();
+ });
+
+ plugin.close();
+ });
+
+ // Open it first
+ plugin.open();
+ });
+
it('releases focus if trapFocus option is true', function(done) {
$html = $(template).appendTo('body');
plugin = new Foundation.OffCanvas($html.find('[data-off-canvas]'), { trapFocus: true });