Skip to content

Commit

Permalink
perf(animation): set after styles should not be recursive
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Nov 16, 2016
1 parent a7042e3 commit 3a2ff85
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/animations/animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ export class Animation {

// since there was no animation, immediately run the after
// ******** DOM WRITE ****************
this._afterAnimation();
this._setAfterStyles();

// this animation has no duration, so it has finished
// other animations could still be running
Expand Down Expand Up @@ -513,7 +513,7 @@ export class Animation {

// set the after styles
// ******** DOM WRITE ****************
this._afterAnimation();
this._setAfterStyles();

// remove the will-change properties
// ******** DOM WRITE ****************
Expand Down Expand Up @@ -789,13 +789,8 @@ export class Animation {
/**
* @private
* DOM WRITE
* RECURSION
*/
_afterAnimation() {
for (var i = 0; i < this._cL; i++) {
this._c[i]._afterAnimation();
}

_setAfterStyles() {
let ele: HTMLElement;
for (var i = 0; i < this._eL; i++) {
ele = this._e[i];
Expand Down Expand Up @@ -991,7 +986,7 @@ export class Animation {
// ******** DOM WRITE ****************
this._progress(stepValue);
this._willChg(false);
this._afterAnimation();
this._setAfterStyles();
this._didFinish(shouldComplete);

} else {
Expand Down

0 comments on commit 3a2ff85

Please sign in to comment.