@@ -424,7 +424,7 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
424
424
var KEY = "$$ngAnimateParentKey" ;
425
425
var parentNode = node . parentNode ;
426
426
var parentID = parentNode [ KEY ] || ( parentNode [ KEY ] = ++ parentCounter ) ;
427
- return parentID + '-' + node . getAttribute ( 'class' ) + '-' + extraClasses ;
427
+ return parentID + '-' + ( node . getAttribute ( 'class' ) || '' ) + '-' + ( extraClasses || '' ) ;
428
428
}
429
429
430
430
function computeCachedCssStyles ( node , className , cacheKey , properties ) {
@@ -472,6 +472,11 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
472
472
return stagger || { } ;
473
473
}
474
474
475
+ function flushGCSCache ( ) {
476
+ gcsLookup . flush ( ) ;
477
+ gcsStaggerLookup . flush ( ) ;
478
+ }
479
+
475
480
var bod = $document [ 0 ] . body ;
476
481
var cancelLastRAFRequest ;
477
482
var rafWaitQueue = [ ] ;
@@ -482,8 +487,7 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
482
487
rafWaitQueue . push ( callback ) ;
483
488
cancelLastRAFRequest = $$rAF ( function ( ) {
484
489
cancelLastRAFRequest = null ;
485
- gcsLookup . flush ( ) ;
486
- gcsStaggerLookup . flush ( ) ;
490
+ flushGCSCache ( ) ;
487
491
488
492
//the line below will force the browser to perform a repaint so
489
493
//that all the animated elements within the animation frame will
@@ -514,7 +518,7 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
514
518
? Math . max ( aD , tD )
515
519
: ( aD || tD ) ;
516
520
timings . maxDuration = Math . max (
517
- timings . animationDuration * timings . animationIterationCount ,
521
+ ( timings . animationDuration * timings . animationIterationCount ) || 0 ,
518
522
timings . transitionDuration ) ;
519
523
520
524
return timings ;
@@ -525,7 +529,7 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
525
529
options = prepareAnimationOptions ( options ) ;
526
530
527
531
var temporaryStyles = [ ] ;
528
- var classes = element . attr ( 'class' ) ;
532
+ var classes = element . attr ( 'class' ) || '' ;
529
533
var styles = packageStyles ( options ) ;
530
534
var animationClosed ;
531
535
var animationPaused ;
@@ -649,7 +653,7 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
649
653
650
654
var timings = computeTimings ( node , fullClassName , cacheKey ) ;
651
655
var relativeDelay = timings . maxDelay ;
652
- maxDelay = Math . max ( relativeDelay , 0 ) ;
656
+ maxDelay = Math . max ( relativeDelay || 0 , 0 ) ;
653
657
maxDuration = timings . maxDuration ;
654
658
655
659
var flags = { } ;
@@ -765,6 +769,12 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
765
769
applyAnimationClasses ( element , options ) ;
766
770
applyAnimationStyles ( element , options ) ;
767
771
772
+ // we need to clear the cache since the post-quiet state may add and remove CSS
773
+ // classes which contain follow-up animation data which will be cached.
774
+ $$rAF ( function ( ) {
775
+ flushGCSCache ( ) ;
776
+ } ) ;
777
+
768
778
// the reason why we have this option is to allow a synchronous closing callback
769
779
// that is fired as SOON as the animation ends (when the CSS is removed) or if
770
780
// the animation never takes off at all. A good example is a leave animation since
@@ -860,7 +870,7 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
860
870
861
871
timings = computeTimings ( node , fullClassName , cacheKey ) ;
862
872
relativeDelay = timings . maxDelay ;
863
- maxDelay = Math . max ( relativeDelay , 0 ) ;
873
+ maxDelay = Math . max ( relativeDelay || 0 , 0 ) ;
864
874
maxDuration = timings . maxDuration ;
865
875
866
876
if ( maxDuration === 0 ) {
@@ -877,7 +887,7 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
877
887
? parseFloat ( options . delay )
878
888
: relativeDelay ;
879
889
880
- maxDelay = Math . max ( relativeDelay , 0 ) ;
890
+ maxDelay = Math . max ( relativeDelay || 0 , 0 ) ;
881
891
882
892
var delayStyle ;
883
893
if ( flags . applyTransitionDelay ) {
0 commit comments