Browse Source

improves the fallback mode fluidity

_emulateDragOver optimized to reduce the interval tics. 
That provides a fluidity similar to the native drag and drop mode.
pull/459/head
sp-kilobug 10 years ago
parent
commit
9e3e0a81a0
  1. 8
      Sortable.js

8
Sortable.js

@ -398,6 +398,12 @@
_emulateDragOver: function () {
if (touchEvt) {
if (this._lastX===touchEvt.clientX && this._lastY===touchEvt.clientY ) {
return;
}
this._lastX=touchEvt.clientX;
this._lastY=touchEvt.clientY;
_css(ghostEl, 'display', 'none');
var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY),
@ -510,7 +516,7 @@
_on(document, 'mouseup', this._onDrop);
}
this._loopId = setInterval(this._emulateDragOver, 150);
this._loopId = setInterval(this._emulateDragOver, 50);
}
else {
if (dataTransfer) {

Loading…
Cancel
Save