From 39b5c3b4627966409c7d3ec2a60fb1f47a6d1db4 Mon Sep 17 00:00:00 2001 From: p-herbert Date: Fri, 11 May 2018 22:27:51 -0700 Subject: [PATCH 1/2] (fix) Bind context to setTimeout --- Sortable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sortable.js b/Sortable.js index 8b32dfb29..0eb4c407a 100644 --- a/Sortable.js +++ b/Sortable.js @@ -467,7 +467,7 @@ _on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler); options.supportPointer && _on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler); - _this._dragStartTimer = setTimeout(dragStartFn, options.delay); + _this._dragStartTimer = setTimeout(dragStartFn, options.delay).bind(_this); } else { dragStartFn(); } From 645a7d06e69e8567dd23c0142fbb9a5804a97e5f Mon Sep 17 00:00:00 2001 From: p-herbert <11701411+p-herbert@users.noreply.github.com> Date: Thu, 8 Nov 2018 14:57:45 -0800 Subject: [PATCH 2/2] (fix) Bind context directly to function --- Sortable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sortable.js b/Sortable.js index 0eb4c407a..9977cbbe3 100644 --- a/Sortable.js +++ b/Sortable.js @@ -467,7 +467,7 @@ _on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler); options.supportPointer && _on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler); - _this._dragStartTimer = setTimeout(dragStartFn, options.delay).bind(_this); + _this._dragStartTimer = setTimeout(dragStartFn.bind(_this), options.delay); } else { dragStartFn(); }