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