improve memory usage

This commit is contained in:
Pavel Reznikov 2015-03-09 21:37:08 -07:00
commit 66388d020c
3 changed files with 6 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -678,17 +678,16 @@
el = $(el);
var node = el.data('_gridstack_node');
this.grid.remove_node(node);
el.removeData('_gridstack_node');
this._update_container_height();
if (detach_node)
el.remove();
else
el.data('_gridstack_node', null);
};
GridStack.prototype.remove_all = function () {
GridStack.prototype.remove_all = function (detach_node) {
_.each(this.grid.nodes, function (node) {
node.el.remove();
});
this.remove_widget(node.el, detach_node);
}, this);
this.grid.nodes = [];
this._update_container_height();
};