version : '5.2.1',
- settings : {},
+ settings : {
+ close_on_click: true,
+ },
init : function (scope, method, options) {
- this.events();
+ this.bindings(method, options);
},
events : function () {
self.click_toggle_class(e, 'move-right');
})
.on('click.fndtn.offcanvas', '.left-off-canvas-menu a', function (e) {
- S(".off-canvas-wrap").removeClass("move-right");
+ var settings = self.get_settings(e)
+ if (settings.close_on_click)
+ S(".off-canvas-wrap").removeClass("move-right");
})
.on('click.fndtn.offcanvas', '.right-off-canvas-toggle', function (e) {
self.click_toggle_class(e, 'move-left');
})
.on('click.fndtn.offcanvas', '.right-off-canvas-menu a', function (e) {
- S(".off-canvas-wrap").removeClass("move-left");
+ var settings = self.get_settings(e)
+ if (settings.close_on_click)
+ S(".off-canvas-wrap").removeClass("move-left");
})
.on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) {
self.click_remove_class(e, 'move-left');
this.S('.off-canvas-wrap').removeClass(class_name);
},
+ get_settings: function(e) {
+ var offcanvas = this.S(e.target).closest('[' + this.attr_name() + ']')
+ return offcanvas.data(this.attr_name(true) + '-init') || this.settings;
+ },
+
reflow : function () {}
};
}(jQuery, this, this.document));