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

Skip to content

Commit a334bc9

Browse files
committed
Merge pull request gridstack#147 from radiolips/bugfix/window-width
_is_one_column_mode unreliable within five pixels
2 parents 2e124b9 + 43b2f0b commit a334bc9

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)