Skip to content

Commit 50bda89

Browse files
committed
Better aging for cached animations
1 parent fca9aae commit 50bda89

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dom/animate/animate.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,12 @@ steal('jquery', 'jquery/dom/styles').then(function ($) {
162162
getAnimation = function(style) {
163163
var lastSheet, name, last;
164164

165-
// Look up the cached style, increment the age for any other animation
165+
// Look up the cached style, set it to that name and reset age if found
166+
// increment the age for any other animation
166167
$.each(cache, function(i, animation) {
167168
if(style === animation.style) {
168169
name = animation.name;
170+
animation.age = 0;
169171
} else {
170172
animation.age += 1;
171173
}

0 commit comments

Comments
 (0)