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

Skip to content

Commit 39498e4

Browse files
committed
update gridstack
1 parent bd815c4 commit 39498e4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

gridstack.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@
107107
}
108108
};
109109

110+
GridStackEngine.prototype.is_area_empty = function (x, y, width, height) {
111+
var nn = {x: x || 0, y: y || 0, width: width || 1, height: height || 1};
112+
var collision_node = _.find(this.nodes, function (n) {
113+
return Utils.is_intercepted(n, nn);
114+
}, this);
115+
return collision_node == null;
116+
};
117+
110118
GridStackEngine.prototype._sort_nodes = function (dir) {
111119
this.nodes = Utils.sort(this.nodes, dir, this.width);
112120
};
@@ -831,6 +839,10 @@
831839
this._update_container_height()
832840
};
833841

842+
GridStack.prototype.is_area_empty = function (x, y, width, height) {
843+
return this.grid.is_area_empty(x, y, width, height);
844+
};
845+
834846
scope.GridStackUI = GridStack;
835847

836848
scope.GridStackUI.Utils = Utils;

0 commit comments

Comments
 (0)