mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 23:58:13 +08:00
fix(gesture): mouse events
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user