fix(gesture): mouse events

This commit is contained in:
Manuel Mtz-Almeida
2017-09-15 16:21:52 -05:00
parent 1fca370a89
commit b5910ff518

View File

@ -85,7 +85,7 @@ export class Gesture {
return; return;
} }
if (this.pan || this.hasPress) { if (this.pan || this.hasPress) {
Context.enableListener(this, 'touchstart', isEnabled, this.attachTo); Context.enableListener(this, 'touchstart', isEnabled);
Context.enableListener(this, 'mousedown', isEnabled, this.attachTo); Context.enableListener(this, 'mousedown', isEnabled, this.attachTo);
if (!isEnabled) { if (!isEnabled) {
this.abortGesture(); this.abortGesture();
@ -124,6 +124,7 @@ export class Gesture {
if (this.lastTouch === 0 || (this.lastTouch + MOUSE_WAIT < timeStamp)) { if (this.lastTouch === 0 || (this.lastTouch + MOUSE_WAIT < timeStamp)) {
if (this.pointerDown(ev, timeStamp)) { if (this.pointerDown(ev, timeStamp)) {
console.log('hola');
this.enableMouse(true); this.enableMouse(true);
this.enableTouch(false); this.enableTouch(false);
} else { } else {
@ -390,9 +391,9 @@ export class Gesture {
private enableMouse(shouldEnable: boolean) { private enableMouse(shouldEnable: boolean) {
if (this.pan) { 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);
} }