Browse Source

Allow click events for touch devices

pull/411/head
Alex Wild 10 years ago
parent
commit
9940598312
  1. 14
      Sortable.js

14
Sortable.js

@ -45,6 +45,8 @@
tapEvt,
touchEvt,
moved,
/** @const */
RSPACE = /\s+/g,
@ -427,6 +429,8 @@
dy = touch.clientY - tapEvt.clientY,
translate3d = evt.touches ? 'translate3d(' + dx + 'px,' + dy + 'px,0)' : 'translate(' + dx + 'px,' + dy + 'px)';
moved = true;
touchEvt = touch;
_css(ghostEl, 'webkitTransform', translate3d);
@ -514,6 +518,8 @@
!options.dragoverBubble && evt.stopPropagation();
}
moved = true;
if (activeGroup && !options.disabled &&
(isOwner
? canSort || (revert = !rootEl.contains(dragEl)) // Reverting item into the original list
@ -666,8 +672,10 @@
this._offUpEvents();
if (evt) {
evt.preventDefault();
!options.dropBubble && evt.stopPropagation();
if (moved) {
evt.preventDefault();
!options.dropBubble && evt.stopPropagation();
}
ghostEl && ghostEl.parentNode.removeChild(ghostEl);
@ -726,6 +734,8 @@
tapEvt =
touchEvt =
moved =
lastEl =
lastCSS =

Loading…
Cancel
Save