Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 38532dd

Browse files
committed
1 parent 88536bb commit 38532dd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

dist/gridstack.min.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/gridstack.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,14 @@
5050
GridStackEngine.prototype._fix_collisions = function (node) {
5151
this._sort_nodes(-1);
5252

53+
var nn = node, has_locked = Boolean(_.find(this.nodes, function (n) { return n.locked }));
54+
if (!this.float && !has_locked) {
55+
nn = {x: 0, y: node.y, width: this.width, height: node.height};
56+
}
57+
5358
while (true) {
5459
var collision_node = _.find(this.nodes, function (n) {
55-
return n != node && Utils.is_intercepted(n, node);
60+
return n != node && Utils.is_intercepted(n, nn);
5661
}, this);
5762
if (typeof collision_node == 'undefined') {
5863
return;

0 commit comments

Comments
 (0)