diff options
| author | Matias Niemelä | 2013-11-23 21:44:14 -0500 | 
|---|---|---|
| committer | Matias Niemelä | 2013-11-23 22:05:04 -0500 | 
| commit | 2efe82309ac8ff4f67df8b6e40a539ea31e15804 (patch) | |
| tree | fe9e53023f8eb3e0de6035786cef601d8377faf8 /src | |
| parent | a090400f09d7993d102f527609879cdc74abae60 (diff) | |
| download | angular.js-2efe82309ac8ff4f67df8b6e40a539ea31e15804.tar.bz2 | |
fix($animate): ensure blocked keyframe animations are unblocked before the DOM operation
Closes #5106
Diffstat (limited to 'src')
| -rw-r--r-- | src/ngAnimate/animate.js | 10 | 
1 files changed, 7 insertions, 3 deletions
| diff --git a/src/ngAnimate/animate.js b/src/ngAnimate/animate.js index 26d48012..fde8a7fa 100644 --- a/src/ngAnimate/animate.js +++ b/src/ngAnimate/animate.js @@ -1032,7 +1032,10 @@ angular.module('ngAnimate', ['ng'])        }        function unblockKeyframeAnimations(element) { -        element[0].style[ANIMATION_PROP] = ''; +        var node = element[0], prop = ANIMATION_PROP; +        if(node.style[prop] && node.style[prop].length > 0) { +          element[0].style[prop] = ''; +        }        }        function animateRun(element, className, activeAnimationComplete) { @@ -1063,8 +1066,6 @@ angular.module('ngAnimate', ['ng'])              appliedStyles.push(CSS_PREFIX + 'transition-property');              appliedStyles.push(CSS_PREFIX + 'transition-duration');            } -        } else { -          unblockKeyframeAnimations(element);          }          if(ii > 0) { @@ -1167,6 +1168,7 @@ angular.module('ngAnimate', ['ng'])          var cancel = preReflowCancellation;          afterReflow(function() {            unblockTransitions(element); +          unblockKeyframeAnimations(element);            //once the reflow is complete then we point cancel to            //the new cancellation function which will remove all of the            //animation properties from the active animation @@ -1232,6 +1234,7 @@ angular.module('ngAnimate', ['ng'])            if(cancellationMethod) {              afterReflow(function() {                unblockTransitions(element); +              unblockKeyframeAnimations(element);                animationCompleted();              });              return cancellationMethod; @@ -1248,6 +1251,7 @@ angular.module('ngAnimate', ['ng'])            if(cancellationMethod) {              afterReflow(function() {                unblockTransitions(element); +              unblockKeyframeAnimations(element);                animationCompleted();              });              return cancellationMethod; | 
