From 7bc8ccf35a73e789a00062038730329b19185ae5 Mon Sep 17 00:00:00 2001 From: romiem Date: Sat, 13 Apr 2013 15:44:37 +0200 Subject: [PATCH] Update animator.js Added support for transition-delay property. --- src/ng/animator.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ng/animator.js b/src/ng/animator.js index 7f0f7b7a8d1b..dc0cb8910b7e 100644 --- a/src/ng/animator.js +++ b/src/ng/animator.js @@ -276,8 +276,11 @@ var $AnimatorProvider = function() { var vendorTransitionProp = $sniffer.vendorPrefix + 'Transition'; var w3cTransitionProp = 'transition'; //one day all browsers will have this - var durationKey = 'Duration'; - var duration = 0; + var durationKey = 'Duration', + delayKey = 'Delay', + duration = 0, + delay = 0; + //we want all the styles defined before and after forEach(element, function(element) { var globalStyles = $window.getComputedStyle(element) || {}; @@ -286,8 +289,14 @@ var $AnimatorProvider = function() { parseFloat(globalStyles[vendorTransitionProp + durationKey]) || 0, duration); + delay = Math.max( + parseFloat(globalStyles[w3cTransitionProp + delayKey]) || + parseFloat(globalStyles[vendorTransitionProp + delayKey]) || + 0, + delay); + }); - $window.setTimeout(done, duration * 1000); + $window.setTimeout(done, (duration + delay) * 1000); } else { done(); }