Commit f20fb331 authored by Ross Harrison's avatar Ross Harrison
Browse files

static grid removes jquery ui requirement

parent cad14ab8
......@@ -683,7 +683,8 @@
accept: '.' + self.opts.itemClass
});
}
trashZone
if(!self.opts.staticGrid){
trashZone
.on('dropover', function(event, ui) {
var el = $(ui.draggable);
var node = el.data('_gridstack_node');
......@@ -700,9 +701,10 @@
}
self._clearRemovingTimeout(el);
});
}
}
if (self.opts.acceptWidgets) {
if (!self.opts.staticGrid && self.opts.acceptWidgets) {
var draggingElement = null;
var onDrag = function(event, ui) {
......@@ -801,7 +803,7 @@
.removeClass('ui-draggable ui-draggable-dragging ui-draggable-disabled')
.unbind('drag', onDrag);
self.container.append(el);
self._prepareElementByNode(el, node);
self._prepareElementsByNode(el, node);
self._updateContainerHeight();
self._triggerChangeEvent();
......@@ -969,7 +971,7 @@
node._isAboutToRemove = false;
};
GridStack.prototype._prepareElementByNode = function(el, node) {
GridStack.prototype._prepareElementsByNode = function(el, node) {
var self = this;
var cellWidth;
......@@ -1119,11 +1121,11 @@
resize: dragOrResize
}));
if (node.noMove || this._isOneColumnMode() || this.opts.staticGrid || this.opts.disableDrag) {
if (node.noMove || this._isOneColumnMode() || this.opts.disableDrag) {
el.draggable('disable');
}
if (node.noResize || this._isOneColumnMode() || this.opts.staticGrid || this.opts.disableResize) {
if (node.noResize || this._isOneColumnMode() || this.opts.disableResize) {
el.resizable('disable');
}
......@@ -1155,7 +1157,9 @@
}, triggerAddEvent);
el.data('_gridstack_node', node);
this._prepareElementByNode(el, node);
if(!this.opts.staticGrid) {
this._prepareElementsByNode(el, node);
}
};
GridStack.prototype.setAnimation = function(enable) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment