|
275 | 275 | fallbackClass: 'sortable-fallback', |
276 | 276 | fallbackOnBody: false, |
277 | 277 | fallbackTolerance: 0, |
278 | | - fallbackOffset: {x: 0, y: 0} |
| 278 | + fallbackOffset: {x: 0, y: 0}, |
| 279 | + supportPointer: Sortable.supportPointer !== false, |
279 | 280 | }; |
280 | 281 |
|
281 | 282 |
|
|
299 | 300 | // Bind events |
300 | 301 | _on(el, 'mousedown', this._onTapStart); |
301 | 302 | _on(el, 'touchstart', this._onTapStart); |
302 | | - _on(el, 'pointerdown', this._onTapStart); |
| 303 | + options.supportPointer && _on(el, 'pointerdown', this._onTapStart); |
303 | 304 |
|
304 | 305 | if (this.nativeDraggable) { |
305 | 306 | _on(el, 'dragover', this); |
|
440 | 441 | _on(ownerDocument, 'mouseup', _this._onDrop); |
441 | 442 | _on(ownerDocument, 'touchend', _this._onDrop); |
442 | 443 | _on(ownerDocument, 'touchcancel', _this._onDrop); |
443 | | - _on(ownerDocument, 'pointercancel', _this._onDrop); |
444 | 444 | _on(ownerDocument, 'selectstart', _this); |
| 445 | + options.supportPointer && _on(ownerDocument, 'pointercancel', _this._onDrop); |
445 | 446 |
|
446 | 447 | if (options.delay) { |
447 | 448 | // If the user moves the pointer or let go the click or touch |
|
452 | 453 | _on(ownerDocument, 'touchcancel', _this._disableDelayedDrag); |
453 | 454 | _on(ownerDocument, 'mousemove', _this._disableDelayedDrag); |
454 | 455 | _on(ownerDocument, 'touchmove', _this._disableDelayedDrag); |
455 | | - _on(ownerDocument, 'pointermove', _this._disableDelayedDrag); |
| 456 | + options.supportPointer && _on(ownerDocument, 'pointermove', _this._disableDelayedDrag); |
456 | 457 |
|
457 | 458 | _this._dragStartTimer = setTimeout(dragStartFn, options.delay); |
458 | 459 | } else { |
|
674 | 675 | _on(document, 'touchmove', _this._onTouchMove); |
675 | 676 | _on(document, 'touchend', _this._onDrop); |
676 | 677 | _on(document, 'touchcancel', _this._onDrop); |
677 | | - _on(document, 'pointermove', _this._onTouchMove); |
678 | | - _on(document, 'pointerup', _this._onDrop); |
| 678 | + |
| 679 | + if (options.supportPointer) { |
| 680 | + _on(document, 'pointermove', _this._onTouchMove); |
| 681 | + _on(document, 'pointerup', _this._onDrop); |
| 682 | + } |
679 | 683 | } else { |
680 | 684 | // Old brwoser |
681 | 685 | _on(document, 'mousemove', _this._onTouchMove); |
|
0 commit comments