diff options
| author | Matias Niemelä | 2013-10-28 10:43:41 -0600 |
|---|---|---|
| committer | Matias Niemelä | 2013-10-28 21:26:35 -0700 |
| commit | 7f0767acaba1ec3c8849244a604b0d1c8c376446 (patch) | |
| tree | 8c9ff0aaabf342c13aea87e158ddb699d255b345 /src/ngAnimate/animate.js | |
| parent | 3d4c80cc3e8b1c3f673507ef252e872c374ba431 (diff) | |
| download | angular.js-7f0767acaba1ec3c8849244a604b0d1c8c376446.tar.bz2 | |
fix($animate): ensure former nodes are fully cleaned up when a follow-up structural animation takes place
Closes #4435
Diffstat (limited to 'src/ngAnimate/animate.js')
| -rw-r--r-- | src/ngAnimate/animate.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ngAnimate/animate.js b/src/ngAnimate/animate.js index b2b88d0a..6b72f4a8 100644 --- a/src/ngAnimate/animate.js +++ b/src/ngAnimate/animate.js @@ -588,6 +588,7 @@ angular.module('ngAnimate', ['ng']) //if an animation is currently running on the element then lets take the steps //to cancel that animation and fire any required callbacks $timeout.cancel(ngAnimateState.flagTimer); + cleanup(element); cancelAnimations(ngAnimateState.animations); (ngAnimateState.done || noop)(); } @@ -700,25 +701,24 @@ angular.module('ngAnimate', ['ng']) return rootAnimateState.disabled || rootAnimateState.running; } - var validState; do { //the element did not reach the root element which means that it //is not apart of the DOM. Therefore there is no reason to do //any animations on it - if(parent.length === 0) return true; + if(parent.length === 0) break; var isRoot = parent[0] == $rootElement[0]; var state = isRoot ? rootAnimateState : parent.data(NG_ANIMATE_STATE); - if(state && (state.disabled != null || state.running != null)) { - validState = state; - break; + var result = state && (!!state.disabled || !!state.running); + if(isRoot || result) { + return result; } if(isRoot) return true; } while(parent = parent.parent()); - return validState ? (validState.disabled || validState.running) : true; + return true; } }]); |
