|
460 | 460 | }, true); |
461 | 461 |
|
462 | 462 | var nearestEmptyInsertDetectEvent = function(evt) { |
463 | | - evt = evt.touches ? evt.touches[0] : evt; |
464 | 463 | if (dragEl) { |
| 464 | + evt = evt.touches ? evt.touches[0] : evt; |
465 | 465 | var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY); |
466 | 466 |
|
467 | 467 | if (nearest) { |
|
477 | 477 | } |
478 | 478 | } |
479 | 479 | }; |
480 | | - // We do not want this to be triggered if completed (bubbling canceled), so only define it here |
481 | | - _on(document, 'dragover', nearestEmptyInsertDetectEvent); |
482 | | - _on(document, 'mousemove', nearestEmptyInsertDetectEvent); |
483 | | - _on(document, 'touchmove', nearestEmptyInsertDetectEvent); |
484 | 480 |
|
485 | 481 | /** |
486 | 482 | * @class Sortable |
|
805 | 801 | _find(dragEl, criteria.trim(), _disableDraggable); |
806 | 802 | }); |
807 | 803 |
|
| 804 | + // We do not want this to be triggered if completed (bubbling canceled), so only define it here |
| 805 | + _on(document, 'dragover', nearestEmptyInsertDetectEvent); |
| 806 | + _on(document, 'mousemove', nearestEmptyInsertDetectEvent); |
| 807 | + _on(document, 'touchmove', nearestEmptyInsertDetectEvent); |
808 | 808 | if (options.supportPointer) { |
809 | 809 | _on(ownerDocument, 'pointerup', _this._onDrop); |
810 | 810 | } else { |
|
1412 | 1412 | } |
1413 | 1413 | }, |
1414 | 1414 |
|
| 1415 | + _offMoveEvents: function() { |
| 1416 | + _off(document, 'dragover', nearestEmptyInsertDetectEvent); |
| 1417 | + _off(document, 'mousemove', nearestEmptyInsertDetectEvent); |
| 1418 | + _off(document, 'touchmove', nearestEmptyInsertDetectEvent); |
| 1419 | + }, |
| 1420 | + |
1415 | 1421 | _offUpEvents: function () { |
1416 | 1422 | var ownerDocument = this.el.ownerDocument; |
1417 | 1423 |
|
|
1458 | 1464 | _css(document.body, 'user-select', ''); |
1459 | 1465 | } |
1460 | 1466 |
|
| 1467 | + this._offMoveEvents(); |
1461 | 1468 | this._offUpEvents(); |
1462 | 1469 |
|
1463 | 1470 | if (evt) { |
|
0 commit comments