From 9e3e0a81a07b24ecfe9a57c00be965d9cdf66cd7 Mon Sep 17 00:00:00 2001 From: sp-kilobug Date: Sat, 27 Jun 2015 17:04:20 +0200 Subject: [PATCH] improves the fallback mode fluidity _emulateDragOver optimized to reduce the interval tics. That provides a fluidity similar to the native drag and drop mode. --- Sortable.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Sortable.js b/Sortable.js index a2477f6..6b246d3 100644 --- a/Sortable.js +++ b/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) {