From 39498e4b252280fe7f8d3a1ad2bc45b0c830371a Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Sun, 8 Mar 2015 22:43:02 -0700 Subject: [PATCH] update gridstack --- gridstack.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gridstack.js b/gridstack.js index 66dcfc6..59b0c78 100644 --- a/gridstack.js +++ b/gridstack.js @@ -107,6 +107,14 @@ } }; + GridStackEngine.prototype.is_area_empty = function (x, y, width, height) { + var nn = {x: x || 0, y: y || 0, width: width || 1, height: height || 1}; + var collision_node = _.find(this.nodes, function (n) { + return Utils.is_intercepted(n, nn); + }, this); + return collision_node == null; + }; + GridStackEngine.prototype._sort_nodes = function (dir) { this.nodes = Utils.sort(this.nodes, dir, this.width); }; @@ -831,6 +839,10 @@ this._update_container_height() }; + GridStack.prototype.is_area_empty = function (x, y, width, height) { + return this.grid.is_area_empty(x, y, width, height); + }; + scope.GridStackUI = GridStack; scope.GridStackUI.Utils = Utils;