$(window).width() is incorrect by about 5 pixels, causing _is_one_column_mode to be incorrect. To test this, go to any gridstack and make the page width 769px. Single column mode via CSS will not kick in, yet elements will not be draggable.

This commit is contained in:
Dylan Weiss 2015-05-19 17:40:04 -04:00
commit 43b2f0b6ee

View file

@ -550,7 +550,7 @@
};
GridStack.prototype._is_one_column_mode = function () {
return $(window).width() <= this.opts.min_width;
return (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) <= this.opts.min_width;
};
GridStack.prototype._prepare_element = function (el) {