Skip to content

Commit

Permalink
fix(gridster): wrong addition solved in add_faux_rows/cols by adding …
Browse files Browse the repository at this point in the history
…parseInt

Closes ducksboard#426, ducksboard#425
  • Loading branch information
rept authored and vieron committed Apr 16, 2015
1 parent d3f25f3 commit d947175
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jquery.gridster.js
Original file line number Diff line number Diff line change
Expand Up @@ -2963,7 +2963,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, 10);

for (var r = max_rows; r > actual_rows; r--) {
for (var c = this.cols; c >= 1; c--) {
Expand All @@ -2989,7 +2989,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, 10);
max_cols = Math.min(max_cols, this.options.max_cols);

for (var c = actual_cols + 1; c <= max_cols; c++) {
Expand Down

0 comments on commit d947175

Please sign in to comment.