|
623 | 623 | disableResize: opts.disableResize || false, |
624 | 624 | rtl: 'auto', |
625 | 625 | removable: false, |
| 626 | + removableOptions: _.defaults(opts.removableOptions || {}, { |
| 627 | + accept: '.' + opts.itemClass |
| 628 | + }), |
626 | 629 | removeTimeout: 2000, |
627 | 630 | verticalMarginUnit: 'px', |
628 | 631 | cellHeightUnit: 'px', |
|
770 | 773 | if (!self.opts.staticGrid && typeof self.opts.removable === 'string') { |
771 | 774 | var trashZone = $(self.opts.removable); |
772 | 775 | if (!this.dd.isDroppable(trashZone)) { |
773 | | - this.dd.droppable(trashZone, { |
774 | | - accept: '.' + self.opts.itemClass |
775 | | - }); |
| 776 | + this.dd.droppable(trashZone, self.opts.removableOptions); |
776 | 777 | } |
777 | 778 | this.dd |
778 | 779 | .on(trashZone, 'dropover', function(event, ui) { |
|
781 | 782 | if (node._grid !== self) { |
782 | 783 | return; |
783 | 784 | } |
| 785 | + el.data('inTrashZone', true); |
784 | 786 | self._setupRemovingTimeout(el); |
785 | 787 | }) |
786 | 788 | .on(trashZone, 'dropout', function(event, ui) { |
|
789 | 791 | if (node._grid !== self) { |
790 | 792 | return; |
791 | 793 | } |
| 794 | + el.data('inTrashZone', false); |
792 | 795 | self._clearRemovingTimeout(el); |
793 | 796 | }); |
794 | 797 | } |
|
1097 | 1100 | } |
1098 | 1101 |
|
1099 | 1102 | 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 || (!self.grid.float && y > self.grid.getGridHeight())) { |
1101 | 1104 | if (!node._temporaryRemoved) { |
1102 | 1105 | if (self.opts.removable === true) { |
1103 | 1106 | self._setupRemovingTimeout(el); |
|
0 commit comments