chore(animation): only clear async when async used

This commit is contained in:
Adam Bradley
2016-02-21 21:29:35 -06:00
parent 1324362cc6
commit f00abb7ad7

View File

@ -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,