From 43b2f0b6ee806e256a04a4b828bb2fb9fdc7056c Mon Sep 17 00:00:00 2001 From: Dylan Weiss Date: Tue, 19 May 2015 17:40:04 -0400 Subject: [PATCH] $(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. --- src/gridstack.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gridstack.js b/src/gridstack.js index 4587c484e..4afdcfc6b 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -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) {