Skip to content

Commit 4913883

Browse files
committed
Include built files.
1 parent 0c424c2 commit 4913883

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

dist/gridstack.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,14 @@
281281
};
282282

283283
GridStackEngine.prototype._notify = function() {
284+
var args = Array.prototype.slice.call(arguments, 0);
285+
args[0] = typeof args[0] === 'undefined' ? [] : [args[0]];
286+
args[1] = typeof args[1] === 'undefined' ? true : args[1];
284287
if (this._updateCounter) {
285288
return;
286289
}
287-
var deletedNodes = Array.prototype.slice.call(arguments, 0);
288-
deletedNodes = deletedNodes.concat(this.getDirtyNodes());
289-
this.onchange(deletedNodes);
290+
var deletedNodes = args[0].concat(this.getDirtyNodes());
291+
this.onchange(deletedNodes, args[1]);
290292
};
291293

292294
GridStackEngine.prototype.cleanNodes = function() {
@@ -345,9 +347,7 @@
345347
node._id = null;
346348
this.nodes = _.without(this.nodes, node);
347349
this._packNodes();
348-
if (detachNode) {
349-
this._notify(node);
350-
}
350+
this._notify(node, detachNode);
351351
};
352352

353353
GridStackEngine.prototype.canMoveNode = function(node, x, y, width, height) {
@@ -578,10 +578,11 @@
578578

579579
this._initStyles();
580580

581-
this.grid = new GridStackEngine(this.opts.width, function(nodes) {
581+
this.grid = new GridStackEngine(this.opts.width, function(nodes, detachNode) {
582+
detachNode = typeof detachNode === 'undefined' ? true : detachNode;
582583
var maxHeight = 0;
583584
_.each(nodes, function(n) {
584-
if (n._id === null) {
585+
if (detachNode && n._id === null) {
585586
if (n.el) {
586587
n.el.remove();
587588
}

0 commit comments

Comments
 (0)