mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
chore(): fix activator typescript errors
This commit is contained in:
@ -2,24 +2,23 @@ import {raf, rafFrames} from '../../util/dom';
|
|||||||
|
|
||||||
|
|
||||||
export class Activator {
|
export class Activator {
|
||||||
|
public activatedClass: any;
|
||||||
|
public queue: Array<any> = [];
|
||||||
|
public active: Array<any> = [];
|
||||||
|
public x: number = 0;
|
||||||
|
public y: number = 0;
|
||||||
|
|
||||||
constructor(app, config, zone) {
|
constructor(public app, config, public zone) {
|
||||||
this.app = app;
|
|
||||||
this.zone = zone;
|
|
||||||
this.queue = [];
|
|
||||||
this.active = [];
|
|
||||||
this.clearStateDefers = 5;
|
|
||||||
this.clearAttempt = 0;
|
|
||||||
this.activatedClass = config.get('activatedClass') || 'activated';
|
this.activatedClass = config.get('activatedClass') || 'activated';
|
||||||
this.x = 0;
|
|
||||||
this.y = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
downAction(ev, activatableEle, pointerX, pointerY, callback) {
|
downAction(ev, activatableEle, pointerX, pointerY) {
|
||||||
// the user just pressed down
|
// the user just pressed down
|
||||||
|
|
||||||
let self = this;
|
let self = this;
|
||||||
if (self.disableActivated(ev)) return false;
|
if (self.disableActivated(ev)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// remember where they pressed
|
// remember where they pressed
|
||||||
self.x = pointerX;
|
self.x = pointerX;
|
||||||
@ -54,7 +53,7 @@ export class Activator {
|
|||||||
self.clearState();
|
self.clearState();
|
||||||
}
|
}
|
||||||
this.zone.runOutsideAngular(() => {
|
this.zone.runOutsideAngular(() => {
|
||||||
rafFrames(self.clearStateDefers, activateUp);
|
rafFrames(CLEAR_STATE_DEFERS, activateUp);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,3 +102,5 @@ export class Activator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const CLEAR_STATE_DEFERS = 5;
|
||||||
|
@ -4,13 +4,12 @@ import {raf, rafFrames} from '../../util/dom';
|
|||||||
|
|
||||||
|
|
||||||
export class RippleActivator extends Activator {
|
export class RippleActivator extends Activator {
|
||||||
|
private expands: any = {};
|
||||||
|
private fades: any = {};
|
||||||
|
private expandSpeed: number;
|
||||||
|
|
||||||
constructor(app, config, zone) {
|
constructor(app, config, zone) {
|
||||||
super(app, config, zone);
|
super(app, config, zone);
|
||||||
|
|
||||||
this.expands = {};
|
|
||||||
this.fades = {};
|
|
||||||
this.expandSpeed = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
downAction(ev, activatableEle, pointerX, pointerY) {
|
downAction(ev, activatableEle, pointerX, pointerY) {
|
||||||
@ -28,6 +27,7 @@ export class RippleActivator extends Activator {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
createRipple(activatableEle, pointerX, pointerY, clientRect) {
|
createRipple(activatableEle, pointerX, pointerY, clientRect) {
|
||||||
|
Reference in New Issue
Block a user