vendor/assets/javascripts/base/_layout.js in active_frontend-16.1.6 vs vendor/assets/javascripts/base/_layout.js in active_frontend-16.1.7
- old
+ new
@@ -9,10 +9,11 @@
this.$window = $(window);
this.settings = {
autoDetect: this.$element.data('auto-detect') || Layout.DEFAULTS.autoDetect,
direction: this.$element.data('direction') || Layout.DEFAULTS.direction,
effect: this.$element.data('effect') || Layout.DEFAULTS.effect,
+ mobileWidth: this.$element.data('mobile-width') || Layout.DEFAULTS.mobileWidth,
target: this.$element.data('target') || Layout.DEFAULTS.target
};
this.options = $.extend({}, Layout.DEFAULTS, this.settings, options);
this.$initialClass = $(this.options.target).attr('class');
@@ -26,10 +27,11 @@
Layout.VERSION = '1.0.0';
Layout.DEFAULTS = {
autoDetect: true,
direction: 'left',
effect: 'slide',
+ mobileWidth: 813,
onToggleCallback: function (toggle) {},
target: '#layout-target'
};
Layout.prototype.constructor = Layout;
@@ -69,10 +71,10 @@
});
};
Layout.prototype.togglePosition = function (klass) {
var target = $(this.options.target);
- var isMobile = this.$window.width() < 767;
+ var isMobile = this.$window.width() < this.options.mobileWidth;
if (this.options.autoDetect === true) {
if (isMobile) {
target.addClass(klass);
} else {