diff --git a/dist/gridstack.js b/dist/gridstack.js
index a6762a4..7a50646 100644
--- a/dist/gridstack.js
+++ b/dist/gridstack.js
@@ -3,52 +3,53 @@
// (c) 2014-2015 Pavel Reznikov
// gridstack.js may be freely distributed under the MIT license.
-(function (factory) {
+(function(factory) {
if (typeof define === 'function' && define.amd) {
- define(['jquery', 'lodash', 'jquery-ui/core', 'jquery-ui/widget', 'jquery-ui/mouse', 'jquery-ui/draggable', 'jquery-ui/resizable'], factory);
+ define(['jquery', 'lodash', 'jquery-ui/core', 'jquery-ui/widget', 'jquery-ui/mouse', 'jquery-ui/draggable',
+ 'jquery-ui/resizable'], factory);
}
else {
factory(jQuery, _);
}
-})(function ($, _) {
+})(function($, _) {
var scope = window;
var Utils = {
- is_intercepted: function (a, b) {
+ is_intercepted: function(a, b) {
return !(a.x + a.width <= b.x || b.x + b.width <= a.x || a.y + a.height <= b.y || b.y + b.height <= a.y);
},
- sort: function (nodes, dir, width) {
- width = width || _.chain(nodes).map(function (node) { return node.x + node.width; }).max().value();
+ sort: function(nodes, dir, width) {
+ width = width || _.chain(nodes).map(function(node) { return node.x + node.width; }).max().value();
dir = dir != -1 ? 1 : -1;
- return _.sortBy(nodes, function (n) { return dir * (n.x + n.y * width); });
+ return _.sortBy(nodes, function(n) { return dir * (n.x + n.y * width); });
},
- create_stylesheet: function (id) {
- var style = document.createElement("style");
- style.setAttribute("type", "text/css");
- style.setAttribute("data-gs-id", id);
+ create_stylesheet: function(id) {
+ var style = document.createElement('style');
+ style.setAttribute('type', 'text/css');
+ style.setAttribute('data-gs-id', id);
if (style.styleSheet) {
- style.styleSheet.cssText = "";
+ style.styleSheet.cssText = '';
}
else {
- style.appendChild(document.createTextNode(""));
+ style.appendChild(document.createTextNode(''));
}
document.getElementsByTagName('head')[0].appendChild(style);
return style.sheet;
},
- insert_css_rule: function (sheet, selector, rules, index) {
- if(typeof sheet.insertRule === 'function') {
- sheet.insertRule(selector + "{" + rules + "}", index);
+ insert_css_rule: function(sheet, selector, rules, index) {
+ if (typeof sheet.insertRule === 'function') {
+ sheet.insertRule(selector + '{' + rules + '}', index);
}
- else if(typeof sheet.addRule === 'function') {
+ else if (typeof sheet.addRule === 'function') {
sheet.addRule(selector, rules, index);
}
},
- toBool: function (v) {
+ toBool: function(v) {
if (typeof v == 'boolean')
return v;
if (typeof v == 'string') {
@@ -61,24 +62,24 @@
var id_seq = 0;
- var GridStackEngine = function (width, onchange, float, height, items) {
+ var GridStackEngine = function(width, onchange, float, height, items) {
this.width = width;
this.float = float || false;
this.height = height || 0;
this.nodes = items || [];
- this.onchange = onchange || function () {};
+ this.onchange = onchange || function() {};
this._update_counter = 0;
this._float = this.float;
};
- GridStackEngine.prototype.batch_update = function () {
+ GridStackEngine.prototype.batch_update = function() {
this._update_counter = 1;
this.float = true;
};
- GridStackEngine.prototype.commit = function () {
+ GridStackEngine.prototype.commit = function() {
this._update_counter = 0;
if (this._update_counter == 0) {
this.float = this._float;
@@ -87,16 +88,16 @@
}
};
- GridStackEngine.prototype._fix_collisions = function (node) {
+ GridStackEngine.prototype._fix_collisions = function(node) {
this._sort_nodes(-1);
- var nn = node, has_locked = Boolean(_.find(this.nodes, function (n) { return n.locked }));
+ var nn = node, has_locked = Boolean(_.find(this.nodes, function(n) { return n.locked }));
if (!this.float && !has_locked) {
nn = {x: 0, y: node.y, width: this.width, height: node.height};
}
while (true) {
- var collision_node = _.find(this.nodes, function (n) {
+ var collision_node = _.find(this.nodes, function(n) {
return n != node && Utils.is_intercepted(n, nn);
}, this);
if (typeof collision_node == 'undefined') {
@@ -107,31 +108,32 @@
}
};
- GridStackEngine.prototype.is_area_empty = function (x, y, width, height) {
+ 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) {
+ 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) {
+ GridStackEngine.prototype._sort_nodes = function(dir) {
this.nodes = Utils.sort(this.nodes, dir, this.width);
};
- GridStackEngine.prototype._pack_nodes = function () {
+ GridStackEngine.prototype._pack_nodes = function() {
this._sort_nodes();
if (this.float) {
- _.each(this.nodes, function (n, i) {
+ _.each(this.nodes, function(n, i) {
if (n._updating || typeof n._orig_y == 'undefined' || n.y == n._orig_y)
return;
var new_y = n.y;
while (new_y >= n._orig_y) {
var collision_node = _.chain(this.nodes)
- .find(function (bn) {
- return n != bn && Utils.is_intercepted({x: n.x, y: new_y, width: n.width, height: n.height}, bn);
+ .find(function(bn) {
+ return n != bn &&
+ Utils.is_intercepted({x: n.x, y: new_y, width: n.width, height: n.height}, bn);
})
.value();
@@ -144,7 +146,7 @@
}, this);
}
else {
- _.each(this.nodes, function (n, i) {
+ _.each(this.nodes, function(n, i) {
if (n.locked)
return;
while (n.y > 0) {
@@ -154,7 +156,7 @@
if (i > 0) {
var collision_node = _.chain(this.nodes)
.take(i)
- .find(function (bn) {
+ .find(function(bn) {
return Utils.is_intercepted({x: n.x, y: new_y, width: n.width, height: n.height}, bn);
})
.value();
@@ -171,7 +173,7 @@
}
};
- GridStackEngine.prototype._prepare_node = function (node, resizing) {
+ GridStackEngine.prototype._prepare_node = function(node, resizing) {
node = _.defaults(node || {}, {width: 1, height: 1, x: 0, y: 0 });
node.x = parseInt('' + node.x);
@@ -213,7 +215,7 @@
return node;
};
- GridStackEngine.prototype._notify = function () {
+ GridStackEngine.prototype._notify = function() {
if (this._update_counter) {
return;
}
@@ -222,12 +224,12 @@
this.onchange(deleted_nodes);
};
- GridStackEngine.prototype.clean_nodes = function () {
- _.each(this.nodes, function (n) {n._dirty = false });
+ GridStackEngine.prototype.clean_nodes = function() {
+ _.each(this.nodes, function(n) {n._dirty = false });
};
- GridStackEngine.prototype.get_dirty_nodes = function () {
- return _.filter(this.nodes, function (n) { return n._dirty; });
+ GridStackEngine.prototype.get_dirty_nodes = function() {
+ return _.filter(this.nodes, function(n) { return n._dirty; });
};
GridStackEngine.prototype.add_node = function(node) {
@@ -244,12 +246,12 @@
if (node.auto_position) {
this._sort_nodes();
- for (var i = 0; ; ++i) {
+ for (var i = 0;; ++i) {
var x = i % this.width, y = Math.floor(i / this.width);
if (x + node.width > this.width) {
continue;
}
- if (!_.find(this.nodes, function (n) {
+ if (!_.find(this.nodes, function(n) {
return Utils.is_intercepted({x: x, y: y, width: node.width, height: node.height}, n);
})) {
node.x = x;
@@ -267,15 +269,15 @@
return node;
};
- GridStackEngine.prototype.remove_node = function (node) {
+ GridStackEngine.prototype.remove_node = function(node) {
node._id = null;
this.nodes = _.without(this.nodes, node);
this._pack_nodes();
this._notify(node);
};
- GridStackEngine.prototype.can_move_node = function (node, x, y, width, height) {
- var has_locked = Boolean(_.find(this.nodes, function (n) { return n.locked }));
+ GridStackEngine.prototype.can_move_node = function(node, x, y, width, height) {
+ var has_locked = Boolean(_.find(this.nodes, function(n) { return n.locked }));
if (!this.height && !has_locked)
return true;
@@ -286,21 +288,29 @@
null,
this.float,
0,
- _.map(this.nodes, function (n) { if (n == node) { cloned_node = $.extend({}, n); return cloned_node; } return $.extend({}, n) }));
+ _.map(this.nodes, function(n) {
+ if (n == node) {
+ cloned_node = $.extend({}, n);
+ return cloned_node;
+ }
+ return $.extend({}, n);
+ }));
clone.move_node(cloned_node, x, y, width, height);
var res = true;
if (has_locked)
- res &= !Boolean(_.find(clone.nodes, function (n) { return n != cloned_node && Boolean(n.locked) && Boolean(n._dirty); }));
+ res &= !Boolean(_.find(clone.nodes, function(n) {
+ return n != cloned_node && Boolean(n.locked) && Boolean(n._dirty);
+ }));
if (this.height)
res &= clone.get_grid_height() <= this.height;
return res;
};
- GridStackEngine.prototype.can_be_placed_with_respect_to_height = function (node) {
+ GridStackEngine.prototype.can_be_placed_with_respect_to_height = function(node) {
if (!this.height)
return true;
@@ -309,12 +319,12 @@
null,
this.float,
0,
- _.map(this.nodes, function (n) { return $.extend({}, n) }));
+ _.map(this.nodes, function(n) { return $.extend({}, n) }));
clone.add_node(node);
return clone.get_grid_height() <= this.height;
};
- GridStackEngine.prototype.move_node = function (node, x, y, width, height, no_pack) {
+ GridStackEngine.prototype.move_node = function(node, x, y, width, height, no_pack) {
if (typeof x != 'number') x = node.x;
if (typeof y != 'number') y = node.y;
if (typeof width != 'number') width = node.width;
@@ -347,28 +357,28 @@
return node;
};
- GridStackEngine.prototype.get_grid_height = function () {
- return _.reduce(this.nodes, function (memo, n) { return Math.max(memo, n.y + n.height); }, 0);
+ GridStackEngine.prototype.get_grid_height = function() {
+ return _.reduce(this.nodes, function(memo, n) { return Math.max(memo, n.y + n.height); }, 0);
};
- GridStackEngine.prototype.begin_update = function (node) {
- _.each(this.nodes, function (n) {
+ GridStackEngine.prototype.begin_update = function(node) {
+ _.each(this.nodes, function(n) {
n._orig_y = n.y;
});
node._updating = true;
};
- GridStackEngine.prototype.end_update = function () {
- _.each(this.nodes, function (n) {
+ GridStackEngine.prototype.end_update = function() {
+ _.each(this.nodes, function(n) {
n._orig_y = n.y;
});
- var n = _.find(this.nodes, function (n) { return n._updating; });
+ var n = _.find(this.nodes, function(n) { return n._updating; });
if (n) {
n._updating = false;
}
};
- var GridStack = function (el, opts) {
+ var GridStack = function(el, opts) {
var self = this, one_column_mode;
this.container = $(el);
@@ -409,9 +419,9 @@
this._init_styles();
- this.grid = new GridStackEngine(this.opts.width, function (nodes) {
+ this.grid = new GridStackEngine(this.opts.width, function(nodes) {
var max_height = 0;
- _.each(nodes, function (n) {
+ _.each(nodes, function(n) {
if (n._id == null) {
n.el.remove();
}
@@ -430,24 +440,29 @@
if (this.opts.auto) {
var elements = [];
var _this = this;
- this.container.children('.' + this.opts.item_class).each(function (index, el) {
+ this.container.children('.' + this.opts.item_class).each(function(index, el) {
el = $(el);
elements.push({
el: el,
- i: parseInt(el.attr('data-gs-x')) + parseInt(el.attr('data-gs-y')) * _this.opts.width // Use opts.width as weight for Y
+ i: parseInt(el.attr('data-gs-x')) + parseInt(el.attr('data-gs-y')) * _this.opts.width
});
});
- _.chain(elements).sortBy(function (x) { return x.i; }).each(function (i) {
+ _.chain(elements).sortBy(function(x) { return x.i; }).each(function(i) {
self._prepare_element(i.el);
}).value();
}
this.set_animation(this.opts.animate);
- this.placeholder = $('
').hide();
- this.container.height((this.grid.get_grid_height()) * (this.opts.cell_height + this.opts.vertical_margin) - this.opts.vertical_margin);
+ this.placeholder = $(
+ '').hide();
- var on_resize_handler = function () {
+ this.container.height(
+ this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) -
+ this.opts.vertical_margin);
+
+ var on_resize_handler = function() {
if (self._is_one_column_mode()) {
if (one_column_mode)
return;
@@ -455,7 +470,7 @@
one_column_mode = true;
self.grid._sort_nodes();
- _.each(self.grid.nodes, function (node) {
+ _.each(self.grid.nodes, function(node) {
self.container.append(node.el);
if (!node.no_move) {
@@ -472,7 +487,7 @@
one_column_mode = false;
- _.each(self.grid.nodes, function (node) {
+ _.each(self.grid.nodes, function(node) {
if (!node.no_move) {
node.el.draggable('enable');
}
@@ -487,7 +502,7 @@
on_resize_handler();
};
- GridStack.prototype._init_styles = function () {
+ GridStack.prototype._init_styles = function() {
if (this._styles_id) {
$('[data-gs-id="' + this._styles_id + '"]').remove();
}
@@ -497,7 +512,7 @@
this._styles._max = 0;
};
- GridStack.prototype._update_styles = function (max_height) {
+ GridStack.prototype._update_styles = function(max_height) {
if (this._styles == null) {
return;
}
@@ -541,18 +556,21 @@
}
};
- GridStack.prototype._update_container_height = function () {
+ GridStack.prototype._update_container_height = function() {
if (this.grid._update_counter) {
return;
}
- this.container.height(this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) - this.opts.vertical_margin);
+ this.container.height(
+ this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) -
+ this.opts.vertical_margin);
};
- GridStack.prototype._is_one_column_mode = function () {
- return (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) <= this.opts.min_width;
+ GridStack.prototype._is_one_column_mode = function() {
+ return (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) <=
+ this.opts.min_width;
};
- GridStack.prototype._prepare_element = function (el) {
+ GridStack.prototype._prepare_element = function(el) {
var self = this;
el = $(el);
@@ -577,7 +595,7 @@
var cell_width, cell_height;
- var on_start_moving = function (event, ui) {
+ var on_start_moving = function(event, ui) {
self.container.append(self.placeholder);
var o = $(this);
self.grid.clean_nodes();
@@ -596,7 +614,7 @@
el.resizable('option', 'minHeight', self.opts.cell_height * (node.min_height || 1));
};
- var on_end_moving = function (event, ui) {
+ var on_end_moving = function(event, ui) {
self.placeholder.detach();
var o = $(this);
node.el = o;
@@ -618,9 +636,9 @@
el.draggable(_.extend(this.opts.draggable, {
start: on_start_moving,
stop: on_end_moving,
- drag: function (event, ui) {
+ drag: function(event, ui) {
var x = Math.round(ui.position.left / cell_width),
- y = Math.floor((ui.position.top + cell_height/2) / cell_height);
+ y = Math.floor((ui.position.top + cell_height / 2) / cell_height);
if (!self.grid.can_move_node(node, x, y, node.width, node.height)) {
return;
}
@@ -631,9 +649,9 @@
})).resizable(_.extend(this.opts.resizable, {
start: on_start_moving,
stop: on_end_moving,
- resize: function (event, ui) {
+ resize: function(event, ui) {
var x = Math.round(ui.position.left / cell_width),
- y = Math.floor((ui.position.top + cell_height/2) / cell_height),
+ y = Math.floor((ui.position.top + cell_height / 2) / cell_height),
width = Math.round(ui.size.width / cell_width),
height = Math.round(ui.size.height / cell_height);
if (!self.grid.can_move_node(node, x, y, width, height)) {
@@ -655,7 +673,7 @@
el.attr('data-gs-locked', node.locked ? 'yes' : null);
};
- GridStack.prototype.set_animation = function (enable) {
+ GridStack.prototype.set_animation = function(enable) {
if (enable) {
this.container.addClass('grid-stack-animate');
}
@@ -664,7 +682,7 @@
}
};
- GridStack.prototype.add_widget = function (el, x, y, width, height, auto_position) {
+ GridStack.prototype.add_widget = function(el, x, y, width, height, auto_position) {
el = $(el);
if (typeof x != 'undefined') el.attr('data-gs-x', x);
if (typeof y != 'undefined') el.attr('data-gs-y', y);
@@ -678,12 +696,12 @@
return el;
};
- GridStack.prototype.will_it_fit = function (x, y, width, height, auto_position) {
+ GridStack.prototype.will_it_fit = function(x, y, width, height, auto_position) {
var node = {x: x, y: y, width: width, height: height, auto_position: auto_position};
return this.grid.can_be_placed_with_respect_to_height(node);
};
- GridStack.prototype.remove_widget = function (el, detach_node) {
+ GridStack.prototype.remove_widget = function(el, detach_node) {
detach_node = typeof detach_node === 'undefined' ? true : detach_node;
el = $(el);
var node = el.data('_gridstack_node');
@@ -694,17 +712,17 @@
el.remove();
};
- GridStack.prototype.remove_all = function (detach_node) {
- _.each(this.grid.nodes, function (node) {
+ GridStack.prototype.remove_all = function(detach_node) {
+ _.each(this.grid.nodes, function(node) {
this.remove_widget(node.el, detach_node);
}, this);
this.grid.nodes = [];
this._update_container_height();
};
- GridStack.prototype.resizable = function (el, val) {
+ GridStack.prototype.resizable = function(el, val) {
el = $(el);
- el.each(function (index, el) {
+ el.each(function(index, el) {
el = $(el);
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
@@ -722,9 +740,9 @@
return this;
};
- GridStack.prototype.movable = function (el, val) {
+ GridStack.prototype.movable = function(el, val) {
el = $(el);
- el.each(function (index, el) {
+ el.each(function(index, el) {
el = $(el);
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
@@ -742,19 +760,19 @@
return this;
};
- GridStack.prototype.disable = function () {
+ GridStack.prototype.disable = function() {
this.movable(this.container.children('.' + this.opts.item_class), false);
this.resizable(this.container.children('.' + this.opts.item_class), false);
};
- GridStack.prototype.enable = function () {
+ GridStack.prototype.enable = function() {
this.movable(this.container.children('.' + this.opts.item_class), true);
this.resizable(this.container.children('.' + this.opts.item_class), true);
};
- GridStack.prototype.locked = function (el, val) {
+ GridStack.prototype.locked = function(el, val) {
el = $(el);
- el.each(function (index, el) {
+ el.each(function(index, el) {
el = $(el);
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
@@ -767,7 +785,7 @@
return this;
};
- GridStack.prototype._update_element = function (el, callback) {
+ GridStack.prototype._update_element = function(el, callback) {
el = $(el).first();
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
@@ -789,8 +807,8 @@
self.grid.end_update();
};
- GridStack.prototype.resize = function (el, width, height) {
- this._update_element(el, function (el, node) {
+ GridStack.prototype.resize = function(el, width, height) {
+ this._update_element(el, function(el, node) {
width = (width != null && typeof width != 'undefined') ? width : node.width;
height = (height != null && typeof height != 'undefined') ? height : node.height;
@@ -798,8 +816,8 @@
});
};
- GridStack.prototype.move = function (el, x, y) {
- this._update_element(el, function (el, node) {
+ GridStack.prototype.move = function(el, x, y) {
+ this._update_element(el, function(el, node) {
x = (x != null && typeof x != 'undefined') ? x : node.x;
y = (y != null && typeof y != 'undefined') ? y : node.y;
@@ -807,8 +825,8 @@
});
};
- GridStack.prototype.update = function (el, x, y, width, height) {
- this._update_element(el, function (el, node) {
+ GridStack.prototype.update = function(el, x, y, width, height) {
+ this._update_element(el, function(el, node) {
x = (x != null && typeof x != 'undefined') ? x : node.x;
y = (y != null && typeof y != 'undefined') ? y : node.y;
width = (width != null && typeof width != 'undefined') ? width : node.width;
@@ -818,7 +836,7 @@
});
};
- GridStack.prototype.cell_height = function (val) {
+ GridStack.prototype.cell_height = function(val) {
if (typeof val == 'undefined') {
return this.opts.cell_height;
}
@@ -829,7 +847,7 @@
this._update_styles();
};
- GridStack.prototype.cell_width = function () {
+ GridStack.prototype.cell_width = function() {
var o = this.container.children('.' + this.opts.item_class).first();
return Math.ceil(o.outerWidth() / o.attr('data-gs-width'));
};
@@ -845,16 +863,16 @@
return {x: Math.floor(relativeLeft / column_width), y: Math.floor(relativeTop / row_height)};
};
- GridStack.prototype.batch_update = function () {
+ GridStack.prototype.batch_update = function() {
this.grid.batch_update();
};
- GridStack.prototype.commit = function () {
+ GridStack.prototype.commit = function() {
this.grid.commit();
- this._update_container_height()
+ this._update_container_height();
};
- GridStack.prototype.is_area_empty = function (x, y, width, height) {
+ GridStack.prototype.is_area_empty = function(x, y, width, height) {
return this.grid.is_area_empty(x, y, width, height);
};
@@ -862,8 +880,8 @@
scope.GridStackUI.Utils = Utils;
- $.fn.gridstack = function (opts) {
- return this.each(function () {
+ $.fn.gridstack = function(opts) {
+ return this.each(function() {
if (!$(this).data('gridstack')) {
$(this).data('gridstack', new GridStack(this, opts));
}
diff --git a/dist/gridstack.min.map b/dist/gridstack.min.map
index bfb26df..9951f12 100644
--- a/dist/gridstack.min.map
+++ b/dist/gridstack.min.map
@@ -1 +1 @@
-{"version":3,"file":"dist/gridstack.min.js","sources":["src/gridstack.js"],"names":["factory","define","amd","jQuery","_","$","scope","window","Utils","is_intercepted","a","b","x","width","y","height","sort","nodes","dir","chain","map","node","max","value","sortBy","n","create_stylesheet","id","style","document","createElement","setAttribute","styleSheet","cssText","appendChild","createTextNode","getElementsByTagName","sheet","insert_css_rule","selector","rules","index","insertRule","addRule","toBool","v","toLowerCase","Boolean","id_seq","GridStackEngine","onchange","float","items","this","_update_counter","_float","prototype","batch_update","commit","_pack_nodes","_notify","_fix_collisions","_sort_nodes","nn","has_locked","find","locked","collision_node","move_node","is_area_empty","each","_updating","_orig_y","new_y","bn","_dirty","i","can_be_moved","take","_prepare_node","resizing","defaults","parseInt","auto_position","no_resize","no_move","deleted_nodes","Array","slice","call","arguments","concat","get_dirty_nodes","clean_nodes","filter","add_node","max_width","Math","min","max_height","min_width","min_height","_id","floor","push","remove_node","without","can_move_node","cloned_node","clone","extend","res","get_grid_height","can_be_placed_with_respect_to_height","no_pack","reduce","memo","begin_update","end_update","GridStack","el","opts","one_column_mode","self","container","item_class","is_nested","closest","size","attr","placeholder_class","handle","cell_height","vertical_margin","auto","_class","random","toFixed","animate","always_show_resize_handle","resizable","autoHide","handles","draggable","scroll","appendTo","addClass","_init_styles","grid","remove","_update_styles","elements","_this","children","_prepare_element","set_animation","placeholder","hide","on_resize_handler","_is_one_column_mode","append","resize","_styles_id","_styles","_max","prefix","_update_container_height","innerWidth","documentElement","clientWidth","body","data","cell_width","on_start_moving","o","ceil","outerWidth","show","on_end_moving","detach","removeAttr","length","trigger","start","stop","drag","event","ui","round","position","left","top","containment","parent","enable","removeClass","add_widget","will_it_fit","remove_widget","detach_node","removeData","remove_all","val","movable","disable","_update_element","callback","first","move","update","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","GridStackUI","fn","gridstack"],"mappings":"CAKA,SAAWA,GACe,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBAAuB,uBAAwBD,GAGpIA,EAAQG,OAAQC,IAErB,SAAUC,EAAGD,GAEZ,GAAIE,GAAQC,OAERC,GACAC,eAAgB,SAAUC,EAAGC,GACzB,QAASD,EAAEE,EAAIF,EAAEG,OAASF,EAAEC,GAAKD,EAAEC,EAAID,EAAEE,OAASH,EAAEE,GAAKF,EAAEI,EAAIJ,EAAEK,QAAUJ,EAAEG,GAAKH,EAAEG,EAAIH,EAAEI,QAAUL,EAAEI,IAG1GE,KAAM,SAAUC,EAAOC,EAAKL,GAGxB,MAFAA,GAAQA,GAAST,EAAEe,MAAMF,GAAOG,IAAI,SAAUC,GAAQ,MAAOA,GAAKT,EAAIS,EAAKR,QAAUS,MAAMC,QAC3FL,EAAa,IAAPA,EAAY,EAAI,GACfd,EAAEoB,OAAOP,EAAO,SAAUQ,GAAK,MAAOP,IAAOO,EAAEb,EAAIa,EAAEX,EAAID,MAGpEa,kBAAmB,SAAUC,GACzB,GAAIC,GAAQC,SAASC,cAAc,QAUnC,OATAF,GAAMG,aAAa,OAAQ,YAC3BH,EAAMG,aAAa,aAAcJ,GAC7BC,EAAMI,WACNJ,EAAMI,WAAWC,QAAU,GAG3BL,EAAMM,YAAYL,SAASM,eAAe,KAE9CN,SAASO,qBAAqB,QAAQ,GAAGF,YAAYN,GAC9CA,EAAMS,OAGjBC,gBAAiB,SAAUD,EAAOE,EAAU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AAMkN,YAAYhN,MAAQA,EAE1BH,EAAEoN,GAAGC,UAAY,SAAUjG,GACvB,MAAOpE,MAAKiB,KAAK,WACRjE,EAAEgD,MAAMsH,KAAK,cACdtK,EAAEgD,MAAMsH,KAAK,YAAa,GAAIpD,GAAUlE,KAAMoE,OAKnDnH,EAAMkN"}
\ No newline at end of file
+{"version":3,"file":"dist/gridstack.min.js","sources":["src/gridstack.js"],"names":["factory","define","amd","jQuery","_","$","scope","window","Utils","is_intercepted","a","b","x","width","y","height","sort","nodes","dir","chain","map","node","max","value","sortBy","n","create_stylesheet","id","style","document","createElement","setAttribute","styleSheet","cssText","appendChild","createTextNode","getElementsByTagName","sheet","insert_css_rule","selector","rules","index","insertRule","addRule","toBool","v","toLowerCase","Boolean","id_seq","GridStackEngine","onchange","float","items","this","_update_counter","_float","prototype","batch_update","commit","_pack_nodes","_notify","_fix_collisions","_sort_nodes","nn","has_locked","find","locked","collision_node","move_node","is_area_empty","each","_updating","_orig_y","new_y","bn","_dirty","i","can_be_moved","take","_prepare_node","resizing","defaults","parseInt","auto_position","no_resize","no_move","deleted_nodes","Array","slice","call","arguments","concat","get_dirty_nodes","clean_nodes","filter","add_node","max_width","Math","min","max_height","min_width","min_height","_id","floor","push","remove_node","without","can_move_node","cloned_node","clone","extend","res","get_grid_height","can_be_placed_with_respect_to_height","no_pack","reduce","memo","begin_update","end_update","GridStack","el","opts","one_column_mode","self","container","item_class","is_nested","closest","size","attr","placeholder_class","handle","cell_height","vertical_margin","auto","_class","random","toFixed","animate","always_show_resize_handle","resizable","autoHide","handles","draggable","scroll","appendTo","addClass","_init_styles","grid","remove","_update_styles","elements","_this","children","_prepare_element","set_animation","placeholder","hide","on_resize_handler","_is_one_column_mode","append","resize","_styles_id","_styles","_max","prefix","_update_container_height","innerWidth","documentElement","clientWidth","body","data","cell_width","on_start_moving","o","ceil","outerWidth","show","on_end_moving","detach","removeAttr","length","trigger","start","stop","drag","event","ui","round","position","left","top","containment","parent","enable","removeClass","add_widget","will_it_fit","remove_widget","detach_node","removeData","remove_all","val","movable","disable","_update_element","callback","first","move","update","get_cell_from_pixel","containerPos","relativeLeft","relativeTop","column_width","row_height","GridStackUI","fn","gridstack"],"mappings":"CAKA,SAAUA,GACgB,kBAAXC,SAAyBA,OAAOC,IACvCD,QAAQ,SAAU,SAAU,iBAAkB,mBAAoB,kBAAmB,sBACjF,uBAAwBD,GAG5BA,EAAQG,OAAQC,IAErB,SAASC,EAAGD,GAEX,GAAIE,GAAQC,OAERC,GACAC,eAAgB,SAASC,EAAGC,GACxB,QAASD,EAAEE,EAAIF,EAAEG,OAASF,EAAEC,GAAKD,EAAEC,EAAID,EAAEE,OAASH,EAAEE,GAAKF,EAAEI,EAAIJ,EAAEK,QAAUJ,EAAEG,GAAKH,EAAEG,EAAIH,EAAEI,QAAUL,EAAEI,IAG1GE,KAAM,SAASC,EAAOC,EAAKL,GAGvB,MAFAA,GAAQA,GAAST,EAAEe,MAAMF,GAAOG,IAAI,SAASC,GAAQ,MAAOA,GAAKT,EAAIS,EAAKR,QAAUS,MAAMC,QAC1FL,EAAa,IAAPA,EAAY,EAAI,GACfd,EAAEoB,OAAOP,EAAO,SAASQ,GAAK,MAAOP,IAAOO,EAAEb,EAAIa,EAAEX,EAAID,MAGnEa,kBAAmB,SAASC,GACxB,GAAIC,GAAQC,SAASC,cAAc,QAUnC,OATAF,GAAMG,aAAa,OAAQ,YAC3BH,EAAMG,aAAa,aAAcJ,GAC7BC,EAAMI,WACNJ,EAAMI,WAAWC,QAAU,GAG3BL,EAAMM,YAAYL,SAASM,eAAe,KAE9CN,SAASO,qBAAqB,QAAQ,GAAGF,YAAYN,GAC9CA,EAAMS,OAGjBC,gBAAiB,SAASD,EAAOE,EAAUC,EAAOC,GACd,kBAArBJ,GAAMK,WACbL,EAAMK,WAAWH,EAAW,IAAMC,EAAQ,IAAKC,GAEjB,kBAAlBJ,GAAMM,SAClBN,EAAMM,QAAQJ,EAAUC,EAAOC,IAIvCG,OAAQ,S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gridstack.js
index a6762a4..7a50646 100644
--- a/src/gridstack.js
+++ b/src/gridstack.js
@@ -3,52 +3,53 @@
// (c) 2014-2015 Pavel Reznikov
// gridstack.js may be freely distributed under the MIT license.
-(function (factory) {
+(function(factory) {
if (typeof define === 'function' && define.amd) {
- define(['jquery', 'lodash', 'jquery-ui/core', 'jquery-ui/widget', 'jquery-ui/mouse', 'jquery-ui/draggable', 'jquery-ui/resizable'], factory);
+ define(['jquery', 'lodash', 'jquery-ui/core', 'jquery-ui/widget', 'jquery-ui/mouse', 'jquery-ui/draggable',
+ 'jquery-ui/resizable'], factory);
}
else {
factory(jQuery, _);
}
-})(function ($, _) {
+})(function($, _) {
var scope = window;
var Utils = {
- is_intercepted: function (a, b) {
+ is_intercepted: function(a, b) {
return !(a.x + a.width <= b.x || b.x + b.width <= a.x || a.y + a.height <= b.y || b.y + b.height <= a.y);
},
- sort: function (nodes, dir, width) {
- width = width || _.chain(nodes).map(function (node) { return node.x + node.width; }).max().value();
+ sort: function(nodes, dir, width) {
+ width = width || _.chain(nodes).map(function(node) { return node.x + node.width; }).max().value();
dir = dir != -1 ? 1 : -1;
- return _.sortBy(nodes, function (n) { return dir * (n.x + n.y * width); });
+ return _.sortBy(nodes, function(n) { return dir * (n.x + n.y * width); });
},
- create_stylesheet: function (id) {
- var style = document.createElement("style");
- style.setAttribute("type", "text/css");
- style.setAttribute("data-gs-id", id);
+ create_stylesheet: function(id) {
+ var style = document.createElement('style');
+ style.setAttribute('type', 'text/css');
+ style.setAttribute('data-gs-id', id);
if (style.styleSheet) {
- style.styleSheet.cssText = "";
+ style.styleSheet.cssText = '';
}
else {
- style.appendChild(document.createTextNode(""));
+ style.appendChild(document.createTextNode(''));
}
document.getElementsByTagName('head')[0].appendChild(style);
return style.sheet;
},
- insert_css_rule: function (sheet, selector, rules, index) {
- if(typeof sheet.insertRule === 'function') {
- sheet.insertRule(selector + "{" + rules + "}", index);
+ insert_css_rule: function(sheet, selector, rules, index) {
+ if (typeof sheet.insertRule === 'function') {
+ sheet.insertRule(selector + '{' + rules + '}', index);
}
- else if(typeof sheet.addRule === 'function') {
+ else if (typeof sheet.addRule === 'function') {
sheet.addRule(selector, rules, index);
}
},
- toBool: function (v) {
+ toBool: function(v) {
if (typeof v == 'boolean')
return v;
if (typeof v == 'string') {
@@ -61,24 +62,24 @@
var id_seq = 0;
- var GridStackEngine = function (width, onchange, float, height, items) {
+ var GridStackEngine = function(width, onchange, float, height, items) {
this.width = width;
this.float = float || false;
this.height = height || 0;
this.nodes = items || [];
- this.onchange = onchange || function () {};
+ this.onchange = onchange || function() {};
this._update_counter = 0;
this._float = this.float;
};
- GridStackEngine.prototype.batch_update = function () {
+ GridStackEngine.prototype.batch_update = function() {
this._update_counter = 1;
this.float = true;
};
- GridStackEngine.prototype.commit = function () {
+ GridStackEngine.prototype.commit = function() {
this._update_counter = 0;
if (this._update_counter == 0) {
this.float = this._float;
@@ -87,16 +88,16 @@
}
};
- GridStackEngine.prototype._fix_collisions = function (node) {
+ GridStackEngine.prototype._fix_collisions = function(node) {
this._sort_nodes(-1);
- var nn = node, has_locked = Boolean(_.find(this.nodes, function (n) { return n.locked }));
+ var nn = node, has_locked = Boolean(_.find(this.nodes, function(n) { return n.locked }));
if (!this.float && !has_locked) {
nn = {x: 0, y: node.y, width: this.width, height: node.height};
}
while (true) {
- var collision_node = _.find(this.nodes, function (n) {
+ var collision_node = _.find(this.nodes, function(n) {
return n != node && Utils.is_intercepted(n, nn);
}, this);
if (typeof collision_node == 'undefined') {
@@ -107,31 +108,32 @@
}
};
- GridStackEngine.prototype.is_area_empty = function (x, y, width, height) {
+ 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) {
+ 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) {
+ GridStackEngine.prototype._sort_nodes = function(dir) {
this.nodes = Utils.sort(this.nodes, dir, this.width);
};
- GridStackEngine.prototype._pack_nodes = function () {
+ GridStackEngine.prototype._pack_nodes = function() {
this._sort_nodes();
if (this.float) {
- _.each(this.nodes, function (n, i) {
+ _.each(this.nodes, function(n, i) {
if (n._updating || typeof n._orig_y == 'undefined' || n.y == n._orig_y)
return;
var new_y = n.y;
while (new_y >= n._orig_y) {
var collision_node = _.chain(this.nodes)
- .find(function (bn) {
- return n != bn && Utils.is_intercepted({x: n.x, y: new_y, width: n.width, height: n.height}, bn);
+ .find(function(bn) {
+ return n != bn &&
+ Utils.is_intercepted({x: n.x, y: new_y, width: n.width, height: n.height}, bn);
})
.value();
@@ -144,7 +146,7 @@
}, this);
}
else {
- _.each(this.nodes, function (n, i) {
+ _.each(this.nodes, function(n, i) {
if (n.locked)
return;
while (n.y > 0) {
@@ -154,7 +156,7 @@
if (i > 0) {
var collision_node = _.chain(this.nodes)
.take(i)
- .find(function (bn) {
+ .find(function(bn) {
return Utils.is_intercepted({x: n.x, y: new_y, width: n.width, height: n.height}, bn);
})
.value();
@@ -171,7 +173,7 @@
}
};
- GridStackEngine.prototype._prepare_node = function (node, resizing) {
+ GridStackEngine.prototype._prepare_node = function(node, resizing) {
node = _.defaults(node || {}, {width: 1, height: 1, x: 0, y: 0 });
node.x = parseInt('' + node.x);
@@ -213,7 +215,7 @@
return node;
};
- GridStackEngine.prototype._notify = function () {
+ GridStackEngine.prototype._notify = function() {
if (this._update_counter) {
return;
}
@@ -222,12 +224,12 @@
this.onchange(deleted_nodes);
};
- GridStackEngine.prototype.clean_nodes = function () {
- _.each(this.nodes, function (n) {n._dirty = false });
+ GridStackEngine.prototype.clean_nodes = function() {
+ _.each(this.nodes, function(n) {n._dirty = false });
};
- GridStackEngine.prototype.get_dirty_nodes = function () {
- return _.filter(this.nodes, function (n) { return n._dirty; });
+ GridStackEngine.prototype.get_dirty_nodes = function() {
+ return _.filter(this.nodes, function(n) { return n._dirty; });
};
GridStackEngine.prototype.add_node = function(node) {
@@ -244,12 +246,12 @@
if (node.auto_position) {
this._sort_nodes();
- for (var i = 0; ; ++i) {
+ for (var i = 0;; ++i) {
var x = i % this.width, y = Math.floor(i / this.width);
if (x + node.width > this.width) {
continue;
}
- if (!_.find(this.nodes, function (n) {
+ if (!_.find(this.nodes, function(n) {
return Utils.is_intercepted({x: x, y: y, width: node.width, height: node.height}, n);
})) {
node.x = x;
@@ -267,15 +269,15 @@
return node;
};
- GridStackEngine.prototype.remove_node = function (node) {
+ GridStackEngine.prototype.remove_node = function(node) {
node._id = null;
this.nodes = _.without(this.nodes, node);
this._pack_nodes();
this._notify(node);
};
- GridStackEngine.prototype.can_move_node = function (node, x, y, width, height) {
- var has_locked = Boolean(_.find(this.nodes, function (n) { return n.locked }));
+ GridStackEngine.prototype.can_move_node = function(node, x, y, width, height) {
+ var has_locked = Boolean(_.find(this.nodes, function(n) { return n.locked }));
if (!this.height && !has_locked)
return true;
@@ -286,21 +288,29 @@
null,
this.float,
0,
- _.map(this.nodes, function (n) { if (n == node) { cloned_node = $.extend({}, n); return cloned_node; } return $.extend({}, n) }));
+ _.map(this.nodes, function(n) {
+ if (n == node) {
+ cloned_node = $.extend({}, n);
+ return cloned_node;
+ }
+ return $.extend({}, n);
+ }));
clone.move_node(cloned_node, x, y, width, height);
var res = true;
if (has_locked)
- res &= !Boolean(_.find(clone.nodes, function (n) { return n != cloned_node && Boolean(n.locked) && Boolean(n._dirty); }));
+ res &= !Boolean(_.find(clone.nodes, function(n) {
+ return n != cloned_node && Boolean(n.locked) && Boolean(n._dirty);
+ }));
if (this.height)
res &= clone.get_grid_height() <= this.height;
return res;
};
- GridStackEngine.prototype.can_be_placed_with_respect_to_height = function (node) {
+ GridStackEngine.prototype.can_be_placed_with_respect_to_height = function(node) {
if (!this.height)
return true;
@@ -309,12 +319,12 @@
null,
this.float,
0,
- _.map(this.nodes, function (n) { return $.extend({}, n) }));
+ _.map(this.nodes, function(n) { return $.extend({}, n) }));
clone.add_node(node);
return clone.get_grid_height() <= this.height;
};
- GridStackEngine.prototype.move_node = function (node, x, y, width, height, no_pack) {
+ GridStackEngine.prototype.move_node = function(node, x, y, width, height, no_pack) {
if (typeof x != 'number') x = node.x;
if (typeof y != 'number') y = node.y;
if (typeof width != 'number') width = node.width;
@@ -347,28 +357,28 @@
return node;
};
- GridStackEngine.prototype.get_grid_height = function () {
- return _.reduce(this.nodes, function (memo, n) { return Math.max(memo, n.y + n.height); }, 0);
+ GridStackEngine.prototype.get_grid_height = function() {
+ return _.reduce(this.nodes, function(memo, n) { return Math.max(memo, n.y + n.height); }, 0);
};
- GridStackEngine.prototype.begin_update = function (node) {
- _.each(this.nodes, function (n) {
+ GridStackEngine.prototype.begin_update = function(node) {
+ _.each(this.nodes, function(n) {
n._orig_y = n.y;
});
node._updating = true;
};
- GridStackEngine.prototype.end_update = function () {
- _.each(this.nodes, function (n) {
+ GridStackEngine.prototype.end_update = function() {
+ _.each(this.nodes, function(n) {
n._orig_y = n.y;
});
- var n = _.find(this.nodes, function (n) { return n._updating; });
+ var n = _.find(this.nodes, function(n) { return n._updating; });
if (n) {
n._updating = false;
}
};
- var GridStack = function (el, opts) {
+ var GridStack = function(el, opts) {
var self = this, one_column_mode;
this.container = $(el);
@@ -409,9 +419,9 @@
this._init_styles();
- this.grid = new GridStackEngine(this.opts.width, function (nodes) {
+ this.grid = new GridStackEngine(this.opts.width, function(nodes) {
var max_height = 0;
- _.each(nodes, function (n) {
+ _.each(nodes, function(n) {
if (n._id == null) {
n.el.remove();
}
@@ -430,24 +440,29 @@
if (this.opts.auto) {
var elements = [];
var _this = this;
- this.container.children('.' + this.opts.item_class).each(function (index, el) {
+ this.container.children('.' + this.opts.item_class).each(function(index, el) {
el = $(el);
elements.push({
el: el,
- i: parseInt(el.attr('data-gs-x')) + parseInt(el.attr('data-gs-y')) * _this.opts.width // Use opts.width as weight for Y
+ i: parseInt(el.attr('data-gs-x')) + parseInt(el.attr('data-gs-y')) * _this.opts.width
});
});
- _.chain(elements).sortBy(function (x) { return x.i; }).each(function (i) {
+ _.chain(elements).sortBy(function(x) { return x.i; }).each(function(i) {
self._prepare_element(i.el);
}).value();
}
this.set_animation(this.opts.animate);
- this.placeholder = $('').hide();
- this.container.height((this.grid.get_grid_height()) * (this.opts.cell_height + this.opts.vertical_margin) - this.opts.vertical_margin);
+ this.placeholder = $(
+ '').hide();
- var on_resize_handler = function () {
+ this.container.height(
+ this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) -
+ this.opts.vertical_margin);
+
+ var on_resize_handler = function() {
if (self._is_one_column_mode()) {
if (one_column_mode)
return;
@@ -455,7 +470,7 @@
one_column_mode = true;
self.grid._sort_nodes();
- _.each(self.grid.nodes, function (node) {
+ _.each(self.grid.nodes, function(node) {
self.container.append(node.el);
if (!node.no_move) {
@@ -472,7 +487,7 @@
one_column_mode = false;
- _.each(self.grid.nodes, function (node) {
+ _.each(self.grid.nodes, function(node) {
if (!node.no_move) {
node.el.draggable('enable');
}
@@ -487,7 +502,7 @@
on_resize_handler();
};
- GridStack.prototype._init_styles = function () {
+ GridStack.prototype._init_styles = function() {
if (this._styles_id) {
$('[data-gs-id="' + this._styles_id + '"]').remove();
}
@@ -497,7 +512,7 @@
this._styles._max = 0;
};
- GridStack.prototype._update_styles = function (max_height) {
+ GridStack.prototype._update_styles = function(max_height) {
if (this._styles == null) {
return;
}
@@ -541,18 +556,21 @@
}
};
- GridStack.prototype._update_container_height = function () {
+ GridStack.prototype._update_container_height = function() {
if (this.grid._update_counter) {
return;
}
- this.container.height(this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) - this.opts.vertical_margin);
+ this.container.height(
+ this.grid.get_grid_height() * (this.opts.cell_height + this.opts.vertical_margin) -
+ this.opts.vertical_margin);
};
- GridStack.prototype._is_one_column_mode = function () {
- return (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) <= this.opts.min_width;
+ GridStack.prototype._is_one_column_mode = function() {
+ return (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) <=
+ this.opts.min_width;
};
- GridStack.prototype._prepare_element = function (el) {
+ GridStack.prototype._prepare_element = function(el) {
var self = this;
el = $(el);
@@ -577,7 +595,7 @@
var cell_width, cell_height;
- var on_start_moving = function (event, ui) {
+ var on_start_moving = function(event, ui) {
self.container.append(self.placeholder);
var o = $(this);
self.grid.clean_nodes();
@@ -596,7 +614,7 @@
el.resizable('option', 'minHeight', self.opts.cell_height * (node.min_height || 1));
};
- var on_end_moving = function (event, ui) {
+ var on_end_moving = function(event, ui) {
self.placeholder.detach();
var o = $(this);
node.el = o;
@@ -618,9 +636,9 @@
el.draggable(_.extend(this.opts.draggable, {
start: on_start_moving,
stop: on_end_moving,
- drag: function (event, ui) {
+ drag: function(event, ui) {
var x = Math.round(ui.position.left / cell_width),
- y = Math.floor((ui.position.top + cell_height/2) / cell_height);
+ y = Math.floor((ui.position.top + cell_height / 2) / cell_height);
if (!self.grid.can_move_node(node, x, y, node.width, node.height)) {
return;
}
@@ -631,9 +649,9 @@
})).resizable(_.extend(this.opts.resizable, {
start: on_start_moving,
stop: on_end_moving,
- resize: function (event, ui) {
+ resize: function(event, ui) {
var x = Math.round(ui.position.left / cell_width),
- y = Math.floor((ui.position.top + cell_height/2) / cell_height),
+ y = Math.floor((ui.position.top + cell_height / 2) / cell_height),
width = Math.round(ui.size.width / cell_width),
height = Math.round(ui.size.height / cell_height);
if (!self.grid.can_move_node(node, x, y, width, height)) {
@@ -655,7 +673,7 @@
el.attr('data-gs-locked', node.locked ? 'yes' : null);
};
- GridStack.prototype.set_animation = function (enable) {
+ GridStack.prototype.set_animation = function(enable) {
if (enable) {
this.container.addClass('grid-stack-animate');
}
@@ -664,7 +682,7 @@
}
};
- GridStack.prototype.add_widget = function (el, x, y, width, height, auto_position) {
+ GridStack.prototype.add_widget = function(el, x, y, width, height, auto_position) {
el = $(el);
if (typeof x != 'undefined') el.attr('data-gs-x', x);
if (typeof y != 'undefined') el.attr('data-gs-y', y);
@@ -678,12 +696,12 @@
return el;
};
- GridStack.prototype.will_it_fit = function (x, y, width, height, auto_position) {
+ GridStack.prototype.will_it_fit = function(x, y, width, height, auto_position) {
var node = {x: x, y: y, width: width, height: height, auto_position: auto_position};
return this.grid.can_be_placed_with_respect_to_height(node);
};
- GridStack.prototype.remove_widget = function (el, detach_node) {
+ GridStack.prototype.remove_widget = function(el, detach_node) {
detach_node = typeof detach_node === 'undefined' ? true : detach_node;
el = $(el);
var node = el.data('_gridstack_node');
@@ -694,17 +712,17 @@
el.remove();
};
- GridStack.prototype.remove_all = function (detach_node) {
- _.each(this.grid.nodes, function (node) {
+ GridStack.prototype.remove_all = function(detach_node) {
+ _.each(this.grid.nodes, function(node) {
this.remove_widget(node.el, detach_node);
}, this);
this.grid.nodes = [];
this._update_container_height();
};
- GridStack.prototype.resizable = function (el, val) {
+ GridStack.prototype.resizable = function(el, val) {
el = $(el);
- el.each(function (index, el) {
+ el.each(function(index, el) {
el = $(el);
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
@@ -722,9 +740,9 @@
return this;
};
- GridStack.prototype.movable = function (el, val) {
+ GridStack.prototype.movable = function(el, val) {
el = $(el);
- el.each(function (index, el) {
+ el.each(function(index, el) {
el = $(el);
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
@@ -742,19 +760,19 @@
return this;
};
- GridStack.prototype.disable = function () {
+ GridStack.prototype.disable = function() {
this.movable(this.container.children('.' + this.opts.item_class), false);
this.resizable(this.container.children('.' + this.opts.item_class), false);
};
- GridStack.prototype.enable = function () {
+ GridStack.prototype.enable = function() {
this.movable(this.container.children('.' + this.opts.item_class), true);
this.resizable(this.container.children('.' + this.opts.item_class), true);
};
- GridStack.prototype.locked = function (el, val) {
+ GridStack.prototype.locked = function(el, val) {
el = $(el);
- el.each(function (index, el) {
+ el.each(function(index, el) {
el = $(el);
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
@@ -767,7 +785,7 @@
return this;
};
- GridStack.prototype._update_element = function (el, callback) {
+ GridStack.prototype._update_element = function(el, callback) {
el = $(el).first();
var node = el.data('_gridstack_node');
if (typeof node == 'undefined' || node == null) {
@@ -789,8 +807,8 @@
self.grid.end_update();
};
- GridStack.prototype.resize = function (el, width, height) {
- this._update_element(el, function (el, node) {
+ GridStack.prototype.resize = function(el, width, height) {
+ this._update_element(el, function(el, node) {
width = (width != null && typeof width != 'undefined') ? width : node.width;
height = (height != null && typeof height != 'undefined') ? height : node.height;
@@ -798,8 +816,8 @@
});
};
- GridStack.prototype.move = function (el, x, y) {
- this._update_element(el, function (el, node) {
+ GridStack.prototype.move = function(el, x, y) {
+ this._update_element(el, function(el, node) {
x = (x != null && typeof x != 'undefined') ? x : node.x;
y = (y != null && typeof y != 'undefined') ? y : node.y;
@@ -807,8 +825,8 @@
});
};
- GridStack.prototype.update = function (el, x, y, width, height) {
- this._update_element(el, function (el, node) {
+ GridStack.prototype.update = function(el, x, y, width, height) {
+ this._update_element(el, function(el, node) {
x = (x != null && typeof x != 'undefined') ? x : node.x;
y = (y != null && typeof y != 'undefined') ? y : node.y;
width = (width != null && typeof width != 'undefined') ? width : node.width;
@@ -818,7 +836,7 @@
});
};
- GridStack.prototype.cell_height = function (val) {
+ GridStack.prototype.cell_height = function(val) {
if (typeof val == 'undefined') {
return this.opts.cell_height;
}
@@ -829,7 +847,7 @@
this._update_styles();
};
- GridStack.prototype.cell_width = function () {
+ GridStack.prototype.cell_width = function() {
var o = this.container.children('.' + this.opts.item_class).first();
return Math.ceil(o.outerWidth() / o.attr('data-gs-width'));
};
@@ -845,16 +863,16 @@
return {x: Math.floor(relativeLeft / column_width), y: Math.floor(relativeTop / row_height)};
};
- GridStack.prototype.batch_update = function () {
+ GridStack.prototype.batch_update = function() {
this.grid.batch_update();
};
- GridStack.prototype.commit = function () {
+ GridStack.prototype.commit = function() {
this.grid.commit();
- this._update_container_height()
+ this._update_container_height();
};
- GridStack.prototype.is_area_empty = function (x, y, width, height) {
+ GridStack.prototype.is_area_empty = function(x, y, width, height) {
return this.grid.is_area_empty(x, y, width, height);
};
@@ -862,8 +880,8 @@
scope.GridStackUI.Utils = Utils;
- $.fn.gridstack = function (opts) {
- return this.each(function () {
+ $.fn.gridstack = function(opts) {
+ return this.each(function() {
if (!$(this).data('gridstack')) {
$(this).data('gridstack', new GridStack(this, opts));
}