Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 030d1c5

Browse files
author
Alain Dumesny
committed
lint issue fix (>120 char)
1 parent 0098c0f commit 030d1c5

File tree

7 files changed

+18
-19
lines changed

7 files changed

+18
-19
lines changed

dist/gridstack.all.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/gridstack.jQueryUI.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,7 @@
7777

7878
JQueryUIGridStackDragDropPlugin.prototype.droppable = function(el, opts) {
7979
el = $(el);
80-
if (opts === 'disable' || opts === 'enable') {
81-
el.droppable(opts);
82-
} else {
83-
el.droppable({
84-
accept: opts.accept
85-
});
86-
}
80+
el.droppable(opts);
8781
return this;
8882
};
8983

dist/gridstack.jQueryUI.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/gridstack.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,9 @@
623623
disableResize: opts.disableResize || false,
624624
rtl: 'auto',
625625
removable: false,
626+
removableOptions: _.defaults(opts.removableOptions || {}, {
627+
accept: '.' + opts.itemClass
628+
}),
626629
removeTimeout: 2000,
627630
verticalMarginUnit: 'px',
628631
cellHeightUnit: 'px',
@@ -770,9 +773,7 @@
770773
if (!self.opts.staticGrid && typeof self.opts.removable === 'string') {
771774
var trashZone = $(self.opts.removable);
772775
if (!this.dd.isDroppable(trashZone)) {
773-
this.dd.droppable(trashZone, {
774-
accept: '.' + self.opts.itemClass
775-
});
776+
this.dd.droppable(trashZone, self.opts.removableOptions);
776777
}
777778
this.dd
778779
.on(trashZone, 'dropover', function(event, ui) {
@@ -781,6 +782,7 @@
781782
if (node._grid !== self) {
782783
return;
783784
}
785+
el.data('inTrashZone', true);
784786
self._setupRemovingTimeout(el);
785787
})
786788
.on(trashZone, 'dropout', function(event, ui) {
@@ -789,6 +791,7 @@
789791
if (node._grid !== self) {
790792
return;
791793
}
794+
el.data('inTrashZone', false);
792795
self._clearRemovingTimeout(el);
793796
});
794797
}
@@ -1097,7 +1100,8 @@
10971100
}
10981101

10991102
if (event.type == 'drag') {
1100-
if (x < 0 || x >= self.grid.width || y < 0 || (!self.grid.float && y > self.grid.getGridHeight())) {
1103+
if (el.data('inTrashZone') || x < 0 || x >= self.grid.width || y < 0 ||
1104+
(!self.grid.float && y > self.grid.getGridHeight())) {
11011105
if (!node._temporaryRemoved) {
11021106
if (self.opts.removable === true) {
11031107
self._setupRemovingTimeout(el);

dist/gridstack.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/gridstack.min.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/gridstack.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,8 @@
11001100
}
11011101

11021102
if (event.type == 'drag') {
1103-
if (el.data('inTrashZone') || x < 0 || x >= self.grid.width || y < 0 || (!self.grid.float && y > self.grid.getGridHeight())) {
1103+
if (el.data('inTrashZone') || x < 0 || x >= self.grid.width || y < 0 ||
1104+
(!self.grid.float && y > self.grid.getGridHeight())) {
11041105
if (!node._temporaryRemoved) {
11051106
if (self.opts.removable === true) {
11061107
self._setupRemovingTimeout(el);

0 commit comments

Comments
 (0)