Commit 030d1c5e authored by Alain Dumesny's avatar Alain Dumesny
Browse files

lint issue fix (>120 char)

parent 0098c0f7
This diff is collapsed.
...@@ -77,13 +77,7 @@ ...@@ -77,13 +77,7 @@
JQueryUIGridStackDragDropPlugin.prototype.droppable = function(el, opts) { JQueryUIGridStackDragDropPlugin.prototype.droppable = function(el, opts) {
el = $(el); el = $(el);
if (opts === 'disable' || opts === 'enable') { el.droppable(opts);
el.droppable(opts);
} else {
el.droppable({
accept: opts.accept
});
}
return this; return this;
}; };
......
...@@ -5,5 +5,5 @@ ...@@ -5,5 +5,5 @@
* gridstack.js may be freely distributed under the MIT license. * gridstack.js may be freely distributed under the MIT license.
* @preserve * @preserve
*/ */
!function(a){if("function"==typeof define&&define.amd)define(["jquery","lodash","gridstack","jquery-ui/data","jquery-ui/disable-selection","jquery-ui/focusable","jquery-ui/form","jquery-ui/ie","jquery-ui/keycode","jquery-ui/labels","jquery-ui/jquery-1-7","jquery-ui/plugin","jquery-ui/safe-active-element","jquery-ui/safe-blur","jquery-ui/scroll-parent","jquery-ui/tabbable","jquery-ui/unique-id","jquery-ui/version","jquery-ui/widget","jquery-ui/widgets/mouse","jquery-ui/widgets/draggable","jquery-ui/widgets/droppable","jquery-ui/widgets/resizable"],a);else if("undefined"!=typeof exports){try{jQuery=require("jquery")}catch(a){}try{_=require("lodash")}catch(a){}try{GridStackUI=require("gridstack")}catch(a){}a(jQuery,_,GridStackUI)}else a(jQuery,_,GridStackUI)}(function(a,b,c){function d(a){c.GridStackDragDropPlugin.call(this,a)}window;return c.GridStackDragDropPlugin.registerPlugin(d),d.prototype=Object.create(c.GridStackDragDropPlugin.prototype),d.prototype.constructor=d,d.prototype.resizable=function(c,d){if(c=a(c),"disable"===d||"enable"===d)c.resizable(d);else if("option"===d){var e=arguments[2],f=arguments[3];c.resizable(d,e,f)}else{var g=c.data("gs-resize-handles")?c.data("gs-resize-handles"):this.grid.opts.resizable.handles;c.resizable(b.extend({},this.grid.opts.resizable,{handles:g},{start:d.start||function(){},stop:d.stop||function(){},resize:d.resize||function(){}}))}return this},d.prototype.draggable=function(c,d){return c=a(c),"disable"===d||"enable"===d?c.draggable(d):c.draggable(b.extend({},this.grid.opts.draggable,{containment:this.grid.opts.isNested?this.grid.container.parent():null,start:d.start||function(){},stop:d.stop||function(){},drag:d.drag||function(){}})),this},d.prototype.droppable=function(b,c){return b=a(b),"disable"===c||"enable"===c?b.droppable(c):b.droppable({accept:c.accept}),this},d.prototype.isDroppable=function(b,c){return b=a(b),Boolean(b.data("droppable"))},d.prototype.on=function(b,c,d){return a(b).on(c,d),this},d}); !function(a){if("function"==typeof define&&define.amd)define(["jquery","lodash","gridstack","jquery-ui/data","jquery-ui/disable-selection","jquery-ui/focusable","jquery-ui/form","jquery-ui/ie","jquery-ui/keycode","jquery-ui/labels","jquery-ui/jquery-1-7","jquery-ui/plugin","jquery-ui/safe-active-element","jquery-ui/safe-blur","jquery-ui/scroll-parent","jquery-ui/tabbable","jquery-ui/unique-id","jquery-ui/version","jquery-ui/widget","jquery-ui/widgets/mouse","jquery-ui/widgets/draggable","jquery-ui/widgets/droppable","jquery-ui/widgets/resizable"],a);else if("undefined"!=typeof exports){try{jQuery=require("jquery")}catch(a){}try{_=require("lodash")}catch(a){}try{GridStackUI=require("gridstack")}catch(a){}a(jQuery,_,GridStackUI)}else a(jQuery,_,GridStackUI)}(function(a,b,c){function d(a){c.GridStackDragDropPlugin.call(this,a)}window;return c.GridStackDragDropPlugin.registerPlugin(d),d.prototype=Object.create(c.GridStackDragDropPlugin.prototype),d.prototype.constructor=d,d.prototype.resizable=function(c,d){if(c=a(c),"disable"===d||"enable"===d)c.resizable(d);else if("option"===d){var e=arguments[2],f=arguments[3];c.resizable(d,e,f)}else{var g=c.data("gs-resize-handles")?c.data("gs-resize-handles"):this.grid.opts.resizable.handles;c.resizable(b.extend({},this.grid.opts.resizable,{handles:g},{start:d.start||function(){},stop:d.stop||function(){},resize:d.resize||function(){}}))}return this},d.prototype.draggable=function(c,d){return c=a(c),"disable"===d||"enable"===d?c.draggable(d):c.draggable(b.extend({},this.grid.opts.draggable,{containment:this.grid.opts.isNested?this.grid.container.parent():null,start:d.start||function(){},stop:d.stop||function(){},drag:d.drag||function(){}})),this},d.prototype.droppable=function(b,c){return b=a(b),b.droppable(c),this},d.prototype.isDroppable=function(b,c){return b=a(b),Boolean(b.data("droppable"))},d.prototype.on=function(b,c,d){return a(b).on(c,d),this},d});
//# sourceMappingURL=gridstack.min.map //# sourceMappingURL=gridstack.min.map
\ No newline at end of file
...@@ -623,6 +623,9 @@ ...@@ -623,6 +623,9 @@
disableResize: opts.disableResize || false, disableResize: opts.disableResize || false,
rtl: 'auto', rtl: 'auto',
removable: false, removable: false,
removableOptions: _.defaults(opts.removableOptions || {}, {
accept: '.' + opts.itemClass
}),
removeTimeout: 2000, removeTimeout: 2000,
verticalMarginUnit: 'px', verticalMarginUnit: 'px',
cellHeightUnit: 'px', cellHeightUnit: 'px',
...@@ -770,9 +773,7 @@ ...@@ -770,9 +773,7 @@
if (!self.opts.staticGrid && typeof self.opts.removable === 'string') { if (!self.opts.staticGrid && typeof self.opts.removable === 'string') {
var trashZone = $(self.opts.removable); var trashZone = $(self.opts.removable);
if (!this.dd.isDroppable(trashZone)) { if (!this.dd.isDroppable(trashZone)) {
this.dd.droppable(trashZone, { this.dd.droppable(trashZone, self.opts.removableOptions);
accept: '.' + self.opts.itemClass
});
} }
this.dd this.dd
.on(trashZone, 'dropover', function(event, ui) { .on(trashZone, 'dropover', function(event, ui) {
...@@ -781,6 +782,7 @@ ...@@ -781,6 +782,7 @@
if (node._grid !== self) { if (node._grid !== self) {
return; return;
} }
el.data('inTrashZone', true);
self._setupRemovingTimeout(el); self._setupRemovingTimeout(el);
}) })
.on(trashZone, 'dropout', function(event, ui) { .on(trashZone, 'dropout', function(event, ui) {
...@@ -789,6 +791,7 @@ ...@@ -789,6 +791,7 @@
if (node._grid !== self) { if (node._grid !== self) {
return; return;
} }
el.data('inTrashZone', false);
self._clearRemovingTimeout(el); self._clearRemovingTimeout(el);
}); });
} }
...@@ -1097,7 +1100,8 @@ ...@@ -1097,7 +1100,8 @@
} }
if (event.type == 'drag') { if (event.type == 'drag') {
if (x < 0 || x >= self.grid.width || y < 0 || (!self.grid.float && y > self.grid.getGridHeight())) { if (el.data('inTrashZone') || x < 0 || x >= self.grid.width || y < 0 ||
(!self.grid.float && y > self.grid.getGridHeight())) {
if (!node._temporaryRemoved) { if (!node._temporaryRemoved) {
if (self.opts.removable === true) { if (self.opts.removable === true) {
self._setupRemovingTimeout(el); self._setupRemovingTimeout(el);
......
This diff is collapsed.
This diff is collapsed.
...@@ -1100,7 +1100,8 @@ ...@@ -1100,7 +1100,8 @@
} }
if (event.type == 'drag') { if (event.type == 'drag') {
if (el.data('inTrashZone') || x < 0 || x >= self.grid.width || y < 0 || (!self.grid.float && y > self.grid.getGridHeight())) { if (el.data('inTrashZone') || x < 0 || x >= self.grid.width || y < 0 ||
(!self.grid.float && y > self.grid.getGridHeight())) {
if (!node._temporaryRemoved) { if (!node._temporaryRemoved) {
if (self.opts.removable === true) { if (self.opts.removable === true) {
self._setupRemovingTimeout(el); self._setupRemovingTimeout(el);
......
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