From dcb3bae44c52b810d3d65fe68e3a14ed05d478dd Mon Sep 17 00:00:00 2001 From: Scott DeSapio Date: Fri, 24 Jun 2016 22:20:05 -0500 Subject: [PATCH 1/2] Replace xOffset and yOffset -> fallbackOffset: {x: 0, y: 0}; Forward PR into dev-branch. --- Sortable.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Sortable.js b/Sortable.js index 52b2d2d..5bf9680 100644 --- a/Sortable.js +++ b/Sortable.js @@ -243,7 +243,8 @@ forceFallback: false, fallbackClass: 'sortable-fallback', fallbackOnBody: false, - fallbackTolerance: 0 + fallbackTolerance: 0, + fallbackOffset: {x: 0, y: 0} }; @@ -513,8 +514,8 @@ var options = this.options, fallbackTolerance = options.fallbackTolerance, touch = evt.touches ? evt.touches[0] : evt, - dx = touch.clientX - tapEvt.clientX, - dy = touch.clientY - tapEvt.clientY, + dx = (touch.clientX - tapEvt.clientX) + this.options.fallbackOffset.x, + dy = (touch.clientY - tapEvt.clientY) + this.options.fallbackOffset.y, translate3d = evt.touches ? 'translate3d(' + dx + 'px,' + dy + 'px,0)' : 'translate(' + dx + 'px,' + dy + 'px)'; // only set the status to dragging, when we are actually dragging From 4f358aeb17a83e2a41a08c893b7df32f4e031d7d Mon Sep 17 00:00:00 2001 From: Scott DeSapio Date: Mon, 27 Jun 2016 07:56:51 -0500 Subject: [PATCH 2/2] Added fallbackOffset = options.fallbackOffset, and this.options.fallbackOffset -> fallbackOffset --- Sortable.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sortable.js b/Sortable.js index 5bf9680..0b528c0 100644 --- a/Sortable.js +++ b/Sortable.js @@ -513,9 +513,10 @@ if (tapEvt) { var options = this.options, fallbackTolerance = options.fallbackTolerance, + fallbackOffset = options.fallbackOffset, touch = evt.touches ? evt.touches[0] : evt, - dx = (touch.clientX - tapEvt.clientX) + this.options.fallbackOffset.x, - dy = (touch.clientY - tapEvt.clientY) + this.options.fallbackOffset.y, + dx = (touch.clientX - tapEvt.clientX) + fallbackOffset.x, + dy = (touch.clientY - tapEvt.clientY) + fallbackOffset.y, translate3d = evt.touches ? 'translate3d(' + dx + 'px,' + dy + 'px,0)' : 'translate(' + dx + 'px,' + dy + 'px)'; // only set the status to dragging, when we are actually dragging