From b5910ff5181ba186d52605c28ab21847c3a51527 Mon Sep 17 00:00:00 2001 From: Manuel Mtz-Almeida Date: Fri, 15 Sep 2017 16:21:52 -0500 Subject: [PATCH] fix(gesture): mouse events --- packages/core/src/components/gesture/gesture.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/core/src/components/gesture/gesture.tsx b/packages/core/src/components/gesture/gesture.tsx index a6fe7e0877..6f5ab7cb3c 100644 --- a/packages/core/src/components/gesture/gesture.tsx +++ b/packages/core/src/components/gesture/gesture.tsx @@ -85,7 +85,7 @@ export class Gesture { return; } if (this.pan || this.hasPress) { - Context.enableListener(this, 'touchstart', isEnabled, this.attachTo); + Context.enableListener(this, 'touchstart', isEnabled); Context.enableListener(this, 'mousedown', isEnabled, this.attachTo); if (!isEnabled) { this.abortGesture(); @@ -124,6 +124,7 @@ export class Gesture { if (this.lastTouch === 0 || (this.lastTouch + MOUSE_WAIT < timeStamp)) { if (this.pointerDown(ev, timeStamp)) { + console.log('hola'); this.enableMouse(true); this.enableTouch(false); } else { @@ -390,9 +391,9 @@ export class Gesture { private enableMouse(shouldEnable: boolean) { if (this.pan) { - Context.enableListener(this, 'document:mousemove', shouldEnable, this.attachTo); + Context.enableListener(this, 'document:mousemove', shouldEnable); } - Context.enableListener(this, 'document:mouseup', shouldEnable, this.attachTo); + Context.enableListener(this, 'document:mouseup', shouldEnable); }