From 2df3c9f58def9584455f7c4bfdabbd12aab58bf9 Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Thu, 26 Sep 2013 14:29:18 -0400 Subject: fix($animate): ensure transition-property is not changed when only keyframe animations are in use Closes #3933 --- src/ngAnimate/animate.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ngAnimate/animate.js b/src/ngAnimate/animate.js index af607568..7f37f143 100644 --- a/src/ngAnimate/animate.js +++ b/src/ngAnimate/animate.js @@ -627,8 +627,10 @@ angular.module('ngAnimate', ['ng']) //temporarily disable the transition so that the enter styles //don't animate twice (this is here to avoid a bug in Chrome/FF). - node.style[w3cTransitionProp + propertyKey] = 'none'; - node.style[vendorTransitionProp + propertyKey] = 'none'; + if(transitionTime > 0) { + node.style[w3cTransitionProp + propertyKey] = 'none'; + node.style[vendorTransitionProp + propertyKey] = 'none'; + } var activeClassName = ''; forEach(className.split(' '), function(klass, i) { @@ -637,8 +639,10 @@ angular.module('ngAnimate', ['ng']) //this triggers a reflow which allows for the transition animation to kick in element.prop('clientWidth'); - node.style[w3cTransitionProp + propertyKey] = ''; - node.style[vendorTransitionProp + propertyKey] = ''; + if(transitionTime > 0) { + node.style[w3cTransitionProp + propertyKey] = ''; + node.style[vendorTransitionProp + propertyKey] = ''; + } element.addClass(activeClassName); var css3AnimationEvents = [w3cAnimationEvent, vendorAnimationEvent, -- cgit v1.2.3