From f00abb7ad735bd9fd9483e4663476fac5721148f Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Sun, 21 Feb 2016 21:29:35 -0600 Subject: [PATCH] chore(animation): only clear async when async used --- ionic/animations/animation.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ionic/animations/animation.ts b/ionic/animations/animation.ts index 4d221f8170..c363d22864 100644 --- a/ionic/animations/animation.ts +++ b/ionic/animations/animation.ts @@ -70,7 +70,7 @@ export class Animation { } } else if (typeof ele === 'string') { - ele = doc.querySelectorAll(ele); + ele = document.querySelectorAll(ele); for (i = 0; i < ele.length; i++) { this._addEle(ele[i]); } @@ -378,8 +378,10 @@ export class Animation { } _clearAsync() { - this._unregTrans && this._unregTrans(); - clearTimeout(this._tmr); + if (this._tmr) { + this._unregTrans && this._unregTrans(); + clearTimeout(this._tmr); + } } _progress(stepValue: number) { @@ -781,8 +783,6 @@ interface EffectState { unit: string; } -const doc: any = document; - const TRANSFORMS = { 'translateX':1, 'translateY':1, 'translateZ':1, 'scale':1, 'scaleX':1, 'scaleY':1, 'scaleZ':1,