r3269 committed - Fixed the initialization of color animations for cases where the first...

r3269 committed - Fixed the initialization of color animations for cases where the first...


Revision: 3269
Author: scott.gonzalez
Date: Sun Sep 20 14:07:38 2009
Log: Fixed the initialization of color animations for cases where the first
step of the animation doesn't happen in the same millisecond as the call to
animate. Fixes #4251 - NaN in color animation (Firefox 3).
http://code.google.com/p/jquery-ui/source/detail?r=3269
Modified:
/trunk/ui/jquery.effects.core.js
=======================================
--- /trunk/ui/jquery.effects.core.js    Fri Sep 18 06:15:57 2009
+++ /trunk/ui/jquery.effects.core.js    Sun Sep 20 14:07:38 2009
@@ -336,9 +336,10 @@
    'borderRightColor', 'borderTopColor', 'color', 'outlineColor'],
function(i, attr) {
    $.fx.step[attr] = function(fx) {
-        if (fx.state === 0) {
+        if (!fx.colorInit) {
            fx.start = getColor(fx.elem, attr);
            fx.end = getRGB(fx.end);
+            fx.colorInit = true;
        }
        fx.elem.style[attr] = 'rgb(' +