diff options
| author | Matias Niemelä | 2013-11-06 01:57:34 -0500 | 
|---|---|---|
| committer | Matias Niemelä | 2013-11-06 02:01:19 -0500 | 
| commit | 9470080762aecca5285d0f5cac4ae01540bbad4c (patch) | |
| tree | a7d5c896504ad499e29ba9953cf5137a196e855b /src/ngAnimate/animate.js | |
| parent | aba0fe683040f753f60a0f8030777d94aa9f58bf (diff) | |
| download | angular.js-9470080762aecca5285d0f5cac4ae01540bbad4c.tar.bz2 | |
fix($animate): only apply the fallback property if any transition animations are detected
Diffstat (limited to 'src/ngAnimate/animate.js')
| -rw-r--r-- | src/ngAnimate/animate.js | 7 | 
1 files changed, 6 insertions, 1 deletions
| diff --git a/src/ngAnimate/animate.js b/src/ngAnimate/animate.js index ec7b38aa..72c29cc3 100644 --- a/src/ngAnimate/animate.js +++ b/src/ngAnimate/animate.js @@ -815,6 +815,8 @@ angular.module('ngAnimate', ['ng'])        var ANIMATION_ITERATION_COUNT_KEY = 'IterationCount';        var NG_ANIMATE_PARENT_KEY = '$$ngAnimateKey';        var NG_ANIMATE_CSS_DATA_KEY = '$$ngAnimateCSS3Data'; +      var NG_ANIMATE_FALLBACK_CLASS_NAME = 'ng-animate-start'; +      var NG_ANIMATE_FALLBACK_ACTIVE_CLASS_NAME = 'ng-animate-active';        var lookupCache = {};        var parentCounter = 0; @@ -954,11 +956,13 @@ angular.module('ngAnimate', ['ng'])          var node = element[0];          //temporarily disable the transition so that the enter styles          //don't animate twice (this is here to avoid a bug in Chrome/FF). +        var activeClassName = '';          if(timings.transitionDuration > 0) { +          element.addClass(NG_ANIMATE_FALLBACK_CLASS_NAME); +          activeClassName += NG_ANIMATE_FALLBACK_ACTIVE_CLASS_NAME + ' ';            node.style[TRANSITION_PROP + PROPERTY_KEY] = 'none';          } -        var activeClassName = 'ng-animate-active ';          forEach(className.split(' '), function(klass, i) {            activeClassName += (i > 0 ? ' ' : '') + klass + '-active';          }); @@ -1118,6 +1122,7 @@ angular.module('ngAnimate', ['ng'])        function animateClose(element, className) {          element.removeClass(className); +        element.removeClass(NG_ANIMATE_FALLBACK_CLASS_NAME);          element.removeData(NG_ANIMATE_CSS_DATA_KEY);        } | 
