Fix the memory leak that was incorrectly iterating rows and columns

This commit is contained in:
Eric Mann
2014-12-17 13:56:45 -08:00
parent 4d6abc862a
commit 4fe62c9be9
6 changed files with 37 additions and 10 deletions
+11 -2
View File
@@ -63,8 +63,13 @@
var d = this.data;
typeof d.left === 'undefined' && (d.left = d.x1);
typeof d.top === 'undefined' && (d.top = d.y1);
if ( d.left === undefined ) {
d.left = d.x1;
}
if ( d.top === undefined ) {
d.top = d.y1;
}
this.coords.x1 = d.left;
this.coords.y1 = d.top;
@@ -3808,6 +3813,8 @@
* @return {Object} Returns the instance of the Gridster class.
*/
fn.add_faux_rows = function(rows) {
rows = window.parseInt( rows, 10 );
var actual_rows = this.rows;
var max_rows = actual_rows + (rows || 1);
@@ -3834,6 +3841,8 @@
* @return {Object} Returns the instance of the Gridster class.
*/
fn.add_faux_cols = function(cols) {
cols = window.parseInt( cols, 10 );
var actual_cols = this.cols;
var max_cols = actual_cols + (cols || 1);
max_cols = Math.min(max_cols, this.options.max_cols);
+2 -2
View File
File diff suppressed because one or more lines are too long
+11 -2
View File
@@ -63,8 +63,13 @@
var d = this.data;
typeof d.left === 'undefined' && (d.left = d.x1);
typeof d.top === 'undefined' && (d.top = d.y1);
if ( d.left === undefined ) {
d.left = d.x1;
}
if ( d.top === undefined ) {
d.top = d.y1;
}
this.coords.x1 = d.left;
this.coords.y1 = d.top;
@@ -3808,6 +3813,8 @@
* @return {Object} Returns the instance of the Gridster class.
*/
fn.add_faux_rows = function(rows) {
rows = window.parseInt( rows, 10 );
var actual_rows = this.rows;
var max_rows = actual_rows + (rows || 1);
@@ -3834,6 +3841,8 @@
* @return {Object} Returns the instance of the Gridster class.
*/
fn.add_faux_cols = function(cols) {
cols = window.parseInt( cols, 10 );
var actual_cols = this.cols;
var max_cols = actual_cols + (cols || 1);
max_cols = Math.min(max_cols, this.options.max_cols);
File diff suppressed because one or more lines are too long
+7 -2
View File
@@ -67,8 +67,13 @@
var d = this.data;
typeof d.left === 'undefined' && (d.left = d.x1);
typeof d.top === 'undefined' && (d.top = d.y1);
if ( d.left === undefined ) {
d.left = d.x1;
}
if ( d.top === undefined ) {
d.top = d.y1;
}
this.coords.x1 = d.left;
this.coords.y1 = d.top;
+4
View File
@@ -2961,6 +2961,8 @@
* @return {Object} Returns the instance of the Gridster class.
*/
fn.add_faux_rows = function(rows) {
rows = window.parseInt( rows, 10 );
var actual_rows = this.rows;
var max_rows = actual_rows + (rows || 1);
@@ -2987,6 +2989,8 @@
* @return {Object} Returns the instance of the Gridster class.
*/
fn.add_faux_cols = function(cols) {
cols = window.parseInt( cols, 10 );
var actual_cols = this.cols;
var max_cols = actual_cols + (cols || 1);
max_cols = Math.min(max_cols, this.options.max_cols);