Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Update animator.js #2396

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/ng/animator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) || {};
Expand All @@ -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();
}
Expand Down