From f3ce2277aa806af35f06996f8f2b895d9cb741c4 Mon Sep 17 00:00:00 2001 From: Ed Mackey Date: Wed, 19 Aug 2015 11:07:39 -0400 Subject: [PATCH] Fix the responsive grid to be able to shrink. --- demos/responsive.html | 2 +- src/jquery.gridster.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/demos/responsive.html b/demos/responsive.html index b35eed2f43..4989f5d2af 100644 --- a/demos/responsive.html +++ b/demos/responsive.html @@ -21,7 +21,7 @@ enabled: true } }).data('gridster'); - $('.gridster ul').css({'width': $(window).width()}); + $('.gridster ul').css({'padding': '0'}); }); diff --git a/src/jquery.gridster.js b/src/jquery.gridster.js index cc3f3df48d..c9fe703e3a 100755 --- a/src/jquery.gridster.js +++ b/src/jquery.gridster.js @@ -3689,7 +3689,7 @@ */ fn.get_responsive_col_width = function () { var cols = this.cols || this.options.max_cols; - return (this.$el[0].scrollWidth - ((cols + 1) * this.options.widget_margins[0])) / cols; + return (this.$el[0].clientWidth - 3 - ((cols + 1) * this.options.widget_margins[0])) / cols; }; /**