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,