@@ -226,6 +226,7 @@ var DETECT_CSS_PROPERTIES = {
226
226
transitionDuration : TRANSITION_DURATION_PROP ,
227
227
transitionDelay : TRANSITION_DELAY_PROP ,
228
228
transitionProperty : TRANSITION_PROP + PROPERTY_KEY ,
229
+ transitionTimingFunction : TRANSITION_PROP + TIMING_KEY ,
229
230
animationDuration : ANIMATION_DURATION_PROP ,
230
231
animationDelay : ANIMATION_DELAY_PROP ,
231
232
animationIterationCount : ANIMATION_PROP + ANIMATION_ITERATION_COUNT_KEY
@@ -292,14 +293,14 @@ function truthyTimingValue(val) {
292
293
return val === 0 || val != null ;
293
294
}
294
295
295
- function getCssTransitionDurationStyle ( duration , applyOnlyDuration ) {
296
+ function getCssTransitionStyle ( timings , duration ) {
296
297
var style = TRANSITION_PROP ;
297
298
var value = duration + 's' ;
298
- if ( applyOnlyDuration ) {
299
- style += DURATION_KEY ;
300
- } else {
301
- value += ' linear all ';
302
- }
299
+
300
+ value += ' ' + timings [ TRANSITION_TIMING_PROP ] ;
301
+ value += ' ' + ( timings [ TRANSITION_PROPERTY_PROP ] || 'all' ) ;
302
+ value += timings [ TRANSITION_DELAY_PROP ] ? ' ' + timings [ TRANSITION_DELAY_PROP ] + 's' : ' ';
303
+
303
304
return [ style , value ] ;
304
305
}
305
306
@@ -550,15 +551,6 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
550
551
temporaryStyles . push ( transitionStyle ) ;
551
552
}
552
553
553
- if ( options . duration >= 0 ) {
554
- applyOnlyDuration = node . style [ TRANSITION_PROP ] . length > 0 ;
555
- var durationStyle = getCssTransitionDurationStyle ( options . duration , applyOnlyDuration ) ;
556
-
557
- // we set the duration so that it will be picked up by getComputedStyle later
558
- applyInlineStyle ( node , durationStyle ) ;
559
- temporaryStyles . push ( durationStyle ) ;
560
- }
561
-
562
554
if ( options . keyframeStyle ) {
563
555
var keyframeStyle = [ ANIMATION_PROP , options . keyframeStyle ] ;
564
556
applyInlineStyle ( node , keyframeStyle ) ;
@@ -571,8 +563,18 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
571
563
: gcsLookup . count ( cacheKey )
572
564
: 0 ;
573
565
574
- var isFirst = itemIndex === 0 ;
566
+ var timings = computeTimings ( node , fullClassName , cacheKey ) ;
567
+
568
+ if ( options . duration > 0 ) {
569
+ // Duration in options overwrites duration set in style
570
+ timings [ TRANSITION_DURATION_PROP ] = options . duration ;
571
+ }
572
+
573
+ var relativeDelay = timings . maxDelay ;
574
+ maxDelay = Math . max ( relativeDelay , 0 ) ;
575
+ maxDuration = timings . maxDuration ;
575
576
577
+ var isFirst = itemIndex === 0 ;
576
578
// this is a pre-emptive way of forcing the setup classes to be added and applied INSTANTLY
577
579
// without causing any combination of transitions to kick in. By adding a negative delay value
578
580
// it forces the setup class' transition to end immediately. We later then remove the negative
@@ -583,16 +585,11 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
583
585
blockTransitions ( node , SAFE_FAST_FORWARD_DURATION_VALUE ) ;
584
586
}
585
587
586
- var timings = computeTimings ( node , fullClassName , cacheKey ) ;
587
- var relativeDelay = timings . maxDelay ;
588
- maxDelay = Math . max ( relativeDelay , 0 ) ;
589
- maxDuration = timings . maxDuration ;
590
-
591
588
var flags = { } ;
592
589
flags . hasTransitions = timings . transitionDuration > 0 ;
593
590
flags . hasAnimations = timings . animationDuration > 0 ;
594
591
flags . hasTransitionAll = flags . hasTransitions && timings . transitionProperty == 'all' ;
595
- flags . applyTransitionDuration = hasToStyles && (
592
+ flags . applyTransitionDuration = options . duration > 0 || hasToStyles && (
596
593
( flags . hasTransitions && ! flags . hasTransitionAll )
597
594
|| ( flags . hasAnimations && ! flags . hasTransitions ) ) ;
598
595
flags . applyAnimationDuration = options . duration && flags . hasAnimations ;
@@ -606,15 +603,15 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
606
603
if ( flags . applyTransitionDuration ) {
607
604
flags . hasTransitions = true ;
608
605
timings . transitionDuration = maxDuration ;
609
- applyOnlyDuration = node . style [ TRANSITION_PROP + PROPERTY_KEY ] . length > 0 ;
610
- temporaryStyles . push ( getCssTransitionDurationStyle ( maxDuration , applyOnlyDuration ) ) ;
606
+ temporaryStyles . push ( getCssTransitionStyle ( timings , maxDuration ) ) ;
611
607
}
612
608
613
609
if ( flags . applyAnimationDuration ) {
614
610
flags . hasAnimations = true ;
615
611
timings . animationDuration = maxDuration ;
616
612
temporaryStyles . push ( getCssKeyframeDurationStyle ( maxDuration ) ) ;
617
613
}
614
+
618
615
}
619
616
620
617
if ( maxDuration === 0 && ! flags . recalculateTimingStyles ) {
0 commit comments