Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 43b2f0b

Browse files
committed
$(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.
1 parent 2e0dbc1 commit 43b2f0b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/gridstack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@
550550
};
551551

552552
GridStack.prototype._is_one_column_mode = function () {
553-
return $(window).width() <= this.opts.min_width;
553+
return (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) <= this.opts.min_width;
554554
};
555555

556556
GridStack.prototype._prepare_element = function (el) {

0 commit comments

Comments
 (0)