Browse Source

Supports touchcancel

pull/49/head
Marius Petcu 11 years ago
parent
commit
5d24bc6ef4
  1. 7
      Sortable.js

7
Sortable.js

@ -59,6 +59,7 @@
,pointerdown ,pointerdown
,pointerup ,pointerup
,pointermove ,pointermove
,pointercancel
; ;
@ -101,10 +102,12 @@
pointerdown = 'pointerdown'; pointerdown = 'pointerdown';
pointerup = 'pointerup'; pointerup = 'pointerup';
pointermove = 'pointermove'; pointermove = 'pointermove';
pointercancel = 'pointercancel';
} else { } else {
pointerdown = 'MSPointerDown'; pointerdown = 'MSPointerDown';
pointerup = 'MSPointerUp'; pointerup = 'MSPointerUp';
pointermove = 'MSPointerMove'; pointermove = 'MSPointerMove';
pointercancel = 'MSPointerCancel';
} }
// Bind events // Bind events
@ -289,8 +292,10 @@
// Bind touch events // Bind touch events
_on(document, 'touchmove', this._onTouchMove); _on(document, 'touchmove', this._onTouchMove);
_on(document, 'touchend', this._onDrop); _on(document, 'touchend', this._onDrop);
_on(document, 'touchcancel', this._onDrop);
_on(document, pointermove, this._onTouchMove); _on(document, pointermove, this._onTouchMove);
_on(document, pointerup, this._onDrop); _on(document, pointerup, this._onDrop);
_on(document, pointercancel, this._onDrop);
this._loopId = setInterval(this._emulateDragOver, 150); this._loopId = setInterval(this._emulateDragOver, 150);
} }
@ -367,8 +372,10 @@
_off(document, 'touchmove', this._onTouchMove); _off(document, 'touchmove', this._onTouchMove);
_off(document, 'touchend', this._onDrop); _off(document, 'touchend', this._onDrop);
_off(document, 'touchcancel', this._onDrop);
_off(document, pointermove, this._onTouchMove); _off(document, pointermove, this._onTouchMove);
_off(document, pointerup, this._onDrop); _off(document, pointerup, this._onDrop);
_off(document, pointercancel, this._onDrop);
if( evt ){ if( evt ){

Loading…
Cancel
Save