Skip to content

Commit

Permalink
build js
Browse files Browse the repository at this point in the history
  • Loading branch information
troolee committed Aug 19, 2016
1 parent bc4d076 commit 56d9ec3
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 80 deletions.
39 changes: 39 additions & 0 deletions dist/gridstack.all.js

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions dist/gridstack.jQueryUI.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 5 additions & 68 deletions dist/gridstack.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,69 +158,6 @@
return this;
};

/**
* @class JQueryUIGridStackDragDropPlugin
* jQuery UI implementation of drag'n'drop gridstack plugin.
*/
function JQueryUIGridStackDragDropPlugin(grid) {
GridStackDragDropPlugin.call(this, grid);
}

GridStackDragDropPlugin.registerPlugin(JQueryUIGridStackDragDropPlugin);

JQueryUIGridStackDragDropPlugin.prototype = Object.create(GridStackDragDropPlugin.prototype);
JQueryUIGridStackDragDropPlugin.prototype.constructor = JQueryUIGridStackDragDropPlugin;

JQueryUIGridStackDragDropPlugin.prototype.resizable = function(el, opts) {
el = $(el);
if (opts === 'disable' || opts === 'enable') {
el.resizable(opts);
} else {
el.resizable(_.extend({}, this.grid.opts.resizable, {
start: opts.start || function() {},
stop: opts.stop || function() {},
resize: opts.resize || function() {}
}));
}
return this;
};

JQueryUIGridStackDragDropPlugin.prototype.draggable = function(el, opts) {
el = $(el);
if (opts === 'disable' || opts === 'enable') {
el.draggable(opts);
} else {
el.draggable(_.extend({}, this.grid.opts.draggable, {
containment: this.grid.opts.isNested ? this.grid.container.parent() : null,
start: opts.start || function() {},
stop: opts.stop || function() {},
drag: opts.drag || function() {}
}));
}
return this;
};

JQueryUIGridStackDragDropPlugin.prototype.droppable = function(el, opts) {
el = $(el);
if (opts === 'disable' || opts === 'enable') {
el.droppable(opts);
} else {
el.droppable({
accept: opts.accept
});
}
return this;
};

JQueryUIGridStackDragDropPlugin.prototype.isDroppable = function(el, opts) {
el = $(el);
return Boolean(el.data('droppable'));
};

JQueryUIGridStackDragDropPlugin.prototype.on = function(el, eventName, callback) {
$(el).on(eventName, callback);
return this;
};

var idSeq = 0;

Expand Down Expand Up @@ -676,7 +613,7 @@
if (this.opts.ddPlugin === false) {
this.opts.ddPlugin = GridStackDragDropPlugin;
} else if (this.opts.ddPlugin === null) {
this.opts.ddPlugin = _.first(GridStackDragDropPlugin.registeredPlugins);
this.opts.ddPlugin = _.first(GridStackDragDropPlugin.registeredPlugins) || GridStackDragDropPlugin;
}

this.dd = new this.opts.ddPlugin(this);
Expand Down Expand Up @@ -1189,8 +1126,8 @@
node._beforeDragX = node.x;
node._beforeDragY = node.y;

el.resizable('option', 'minWidth', cellWidth * (node.minWidth || 1));
el.resizable('option', 'minHeight', strictCellHeight * (node.minHeight || 1));
self.dd.resizable(el, 'option', 'minWidth', cellWidth * (node.minWidth || 1));
self.dd.resizable(el, 'option', 'minHeight', strictCellHeight * (node.minHeight || 1));

if (event.type == 'resizestart') {
o.find('.grid-stack-item').trigger('resizestart');
Expand Down Expand Up @@ -1398,9 +1335,9 @@

node.noResize = !(val || false);
if (node.noResize || self._isOneColumnMode()) {
el.resizable('disable');
self.dd.resizable(el, 'disable');
} else {
el.resizable('enable');
self.dd.resizable(el, 'enable');
}
});
return this;
Expand Down

0 comments on commit 56d9ec3

Please sign in to comment.