From 48757ebbe8a0e74258d81f50a229c415bb48767b Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Tue, 12 Jan 2016 11:56:30 -0600 Subject: [PATCH] chore(): fix activator typescript errors --- ionic/components/tap-click/activator.ts | 25 +++++++++++++------------ ionic/components/tap-click/ripple.ts | 8 ++++---- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/ionic/components/tap-click/activator.ts b/ionic/components/tap-click/activator.ts index 6864929e4b..5b0196600a 100644 --- a/ionic/components/tap-click/activator.ts +++ b/ionic/components/tap-click/activator.ts @@ -2,24 +2,23 @@ import {raf, rafFrames} from '../../util/dom'; export class Activator { + public activatedClass: any; + public queue: Array = []; + public active: Array = []; + public x: number = 0; + public y: number = 0; - constructor(app, config, zone) { - this.app = app; - this.zone = zone; - this.queue = []; - this.active = []; - this.clearStateDefers = 5; - this.clearAttempt = 0; + constructor(public app, config, public zone) { 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 let self = this; - if (self.disableActivated(ev)) return false; + if (self.disableActivated(ev)) { + return false; + } // remember where they pressed self.x = pointerX; @@ -54,7 +53,7 @@ export class Activator { self.clearState(); } this.zone.runOutsideAngular(() => { - rafFrames(self.clearStateDefers, activateUp); + rafFrames(CLEAR_STATE_DEFERS, activateUp); }); } @@ -103,3 +102,5 @@ export class Activator { } } + +const CLEAR_STATE_DEFERS = 5; diff --git a/ionic/components/tap-click/ripple.ts b/ionic/components/tap-click/ripple.ts index e3c4cafde1..f5bb16e0a1 100644 --- a/ionic/components/tap-click/ripple.ts +++ b/ionic/components/tap-click/ripple.ts @@ -4,13 +4,12 @@ import {raf, rafFrames} from '../../util/dom'; export class RippleActivator extends Activator { + private expands: any = {}; + private fades: any = {}; + private expandSpeed: number; constructor(app, config, zone) { super(app, config, zone); - - this.expands = {}; - this.fades = {}; - this.expandSpeed = null; } downAction(ev, activatableEle, pointerX, pointerY) { @@ -28,6 +27,7 @@ export class RippleActivator extends Activator { }); }); } + return true; } createRipple(activatableEle, pointerX, pointerY, clientRect) {