From 8b6a48bf8c6668af46d25878186b6a8c3a76e30f Mon Sep 17 00:00:00 2001 From: Stijn Verrept Date: Mon, 8 Sep 2014 16:45:46 +0200 Subject: [PATCH 1/3] Wrong addition solved in add_faux_rows by adding parseInt --- dist/jquery.gridster.js | 2 +- src/jquery.gridster.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/jquery.gridster.js b/dist/jquery.gridster.js index f5b5fd2b..73551adc 100644 --- a/dist/jquery.gridster.js +++ b/dist/jquery.gridster.js @@ -3795,7 +3795,7 @@ */ fn.add_faux_rows = function(rows) { var actual_rows = this.rows; - var max_rows = actual_rows + (rows || 1); + var max_rows = actual_rows + parseInt(rows || 1); for (var r = max_rows; r > actual_rows; r--) { for (var c = this.cols; c >= 1; c--) { diff --git a/src/jquery.gridster.js b/src/jquery.gridster.js index 7bac9118..bbfde924 100755 --- a/src/jquery.gridster.js +++ b/src/jquery.gridster.js @@ -2960,7 +2960,7 @@ */ fn.add_faux_rows = function(rows) { var actual_rows = this.rows; - var max_rows = actual_rows + (rows || 1); + var max_rows = actual_rows + parseInt(rows || 1); for (var r = max_rows; r > actual_rows; r--) { for (var c = this.cols; c >= 1; c--) { From 4525aa1912fb6baca741916d6d62918234159260 Mon Sep 17 00:00:00 2001 From: Stijn Verrept Date: Wed, 10 Sep 2014 22:50:01 +0200 Subject: [PATCH 2/3] Also added parseInt to the add_faux_cols method --- src/jquery.gridster.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jquery.gridster.js b/src/jquery.gridster.js index bbfde924..b3a199c0 100755 --- a/src/jquery.gridster.js +++ b/src/jquery.gridster.js @@ -2986,7 +2986,7 @@ */ fn.add_faux_cols = function(cols) { var actual_cols = this.cols; - var max_cols = actual_cols + (cols || 1); + var max_cols = actual_cols + parseInt(cols || 1); max_cols = Math.min(max_cols, this.options.max_cols); for (var c = actual_cols + 1; c <= max_cols; c++) { From 9099da87d617eb1c6d159313dbeb7eabee787989 Mon Sep 17 00:00:00 2001 From: Stijn Verrept Date: Wed, 10 Sep 2014 22:54:54 +0200 Subject: [PATCH 3/3] Also added parseInt to the add_faux_cols method --- dist/jquery.gridster.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/jquery.gridster.js b/dist/jquery.gridster.js index 73551adc..be6364e3 100644 --- a/dist/jquery.gridster.js +++ b/dist/jquery.gridster.js @@ -3821,7 +3821,7 @@ */ fn.add_faux_cols = function(cols) { var actual_cols = this.cols; - var max_cols = actual_cols + (cols || 1); + var max_cols = actual_cols + parseInt(cols || 1); max_cols = Math.min(max_cols, this.options.max_cols); for (var c = actual_cols + 1; c <= max_cols; c++) {