hack for meteor support
This commit is contained in:
parent
ce2cd06c01
commit
c34777b2a0
4 changed files with 29 additions and 3 deletions
11
dist/gridstack.js
vendored
11
dist/gridstack.js
vendored
|
|
@ -153,6 +153,11 @@
|
|||
}
|
||||
};
|
||||
|
||||
// For Meteor support: https://github.com/troolee/gridstack.js/pull/272
|
||||
GridStackEngine.prototype.getNodeDataByDOMEl = function(el) {
|
||||
return _.find(this.nodes, function(n) { return el.get(0) === n.el.get(0); });
|
||||
};
|
||||
|
||||
GridStackEngine.prototype._fixCollisions = function(node) {
|
||||
var self = this;
|
||||
this._sortNodes(-1);
|
||||
|
|
@ -932,6 +937,12 @@
|
|||
detachNode = typeof detachNode === 'undefined' ? true : detachNode;
|
||||
el = $(el);
|
||||
var node = el.data('_gridstack_node');
|
||||
|
||||
// For Meteor support: https://github.com/troolee/gridstack.js/pull/272
|
||||
if (!node) {
|
||||
node = this.grid.getNodeDataByDOMEl(el);
|
||||
}
|
||||
|
||||
this.grid.removeNode(node);
|
||||
el.removeData('_gridstack_node');
|
||||
this._updateContainerHeight();
|
||||
|
|
|
|||
8
dist/gridstack.min.js
vendored
8
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
|
|
@ -153,6 +153,11 @@
|
|||
}
|
||||
};
|
||||
|
||||
// For Meteor support: https://github.com/troolee/gridstack.js/pull/272
|
||||
GridStackEngine.prototype.getNodeDataByDOMEl = function(el) {
|
||||
return _.find(this.nodes, function(n) { return el.get(0) === n.el.get(0); });
|
||||
};
|
||||
|
||||
GridStackEngine.prototype._fixCollisions = function(node) {
|
||||
var self = this;
|
||||
this._sortNodes(-1);
|
||||
|
|
@ -932,6 +937,12 @@
|
|||
detachNode = typeof detachNode === 'undefined' ? true : detachNode;
|
||||
el = $(el);
|
||||
var node = el.data('_gridstack_node');
|
||||
|
||||
// For Meteor support: https://github.com/troolee/gridstack.js/pull/272
|
||||
if (!node) {
|
||||
node = this.grid.getNodeDataByDOMEl(el);
|
||||
}
|
||||
|
||||
this.grid.removeNode(node);
|
||||
el.removeData('_gridstack_node');
|
||||
this._updateContainerHeight();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue