From 4b7134df3440c9ee625f2e6cd4f37e12fb26c241 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Mon, 28 Sep 2015 11:01:50 -0500 Subject: [PATCH] fix(animation): reset vars, not null --- ionic/animations/animation.ts | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/ionic/animations/animation.ts b/ionic/animations/animation.ts index c88febc0eb..8ff86f6311 100644 --- a/ionic/animations/animation.ts +++ b/ionic/animations/animation.ts @@ -25,13 +25,23 @@ import {extend} from '../util/util'; export class Animation { constructor(ele, opts={}) { - this._el = []; - this._chld = []; - this._ani = []; + this.reset(); this._opts = extend({ renderDelay: 36 }, opts); + this.elements(ele); + + if (!document.documentElement.animate) { + console.error('Web Animations polyfill missing'); + } + } + + reset() { + this._el = []; + this._chld = []; + this._ani = []; + this._bfAdd = []; this._bfSty = {}; this._bfRmv = []; @@ -41,12 +51,6 @@ export class Animation { this._readys = []; this._plays = []; this._finishes = []; - - this.elements(ele); - - if (!document.documentElement.animate) { - console.error('Web Animations polyfill missing'); - } } elements(ele) { @@ -502,7 +506,7 @@ export class Animation { this._ani[i].dispose(); } - this._el = this._parent = this._chld = this._ani = this._readys = this._plays = this._finishes = null; + this.reset(); } /*