gridster: passing Math (not null) as first argument in Math.max.apply()

This commit is contained in:
vieron
2012-07-25 17:58:18 +02:00
parent f12cebb33e
commit e4e06f4cde

View File

@@ -228,7 +228,7 @@
}, this)); }, this));
if (callback) { if (callback) {
callback.apply(this, el); callback.call(this, el);
} }
}, this)); }, this));
}; };
@@ -1550,7 +1550,7 @@
diffs.push(temp_y_units); diffs.push(temp_y_units);
}); });
var max_diff = Math.max.apply(null, diffs); var max_diff = Math.max.apply(Math, diffs);
y_units = (y_units - max_diff); y_units = (y_units - max_diff);
return y_units > 0 ? y_units : 0; return y_units > 0 ? y_units : 0;
@@ -1907,7 +1907,7 @@
} }
} }
var highest_row = Math.max.apply(null, rows); var highest_row = Math.max.apply(Math, rows);
this.highest_occupied_cell = { this.highest_occupied_cell = {
col: row_in_col[highest_row], col: row_in_col[highest_row],
@@ -2148,8 +2148,8 @@
return $(this).attr('data-row'); return $(this).attr('data-row');
}); });
var min_cols = Math.max.apply(null, actual_cols); var min_cols = Math.max.apply(Math, actual_cols);
var min_rows = Math.max.apply(null, actual_rows); var min_rows = Math.max.apply(Math, actual_rows);
this.cols = Math.max(min_cols, cols, this.options.min_cols); this.cols = Math.max(min_cols, cols, this.options.min_cols);
this.rows = Math.max(min_rows, rows, this.options.min_rows); this.rows = Math.max(min_rows, rows, this.options.min_rows);