improve memory usage
This commit is contained in:
parent
fc28ca5947
commit
66388d020c
3 changed files with 6 additions and 7 deletions
2
dist/gridstack.min.js
vendored
2
dist/gridstack.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/gridstack.min.map
vendored
2
dist/gridstack.min.map
vendored
File diff suppressed because one or more lines are too long
|
|
@ -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();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue