Changeset 7809

Show
Ignore:
Timestamp:
03/27/07 12:57:22 (22 months ago)
Author:
jkuhnert
Message:

Fixed bad reference to old dojo.animation.Animation and used the new dojo.lfx style animation for broken color change action type.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/widget/Show.js

    r7085 r7809  
    1111dojo.require("dojo.html.display"); 
    1212dojo.require("dojo.html.layout"); 
    13 //dojo.require("dojo.animation.Animation"); 
    1413dojo.require("dojo.gfx.color"); 
    1514 
     
    437436                                        dojo.lfx.html.wipeOut(component, duration).play(); 
    438437                                }else if(tmpAction == "color"){ 
    439                                         var from = new dojo.gfx.color.Color(action.from).toRgb(); 
    440                                         var to = new dojo.gfx.color.Color(action.to).toRgb(); 
    441                                         var anim = new dojo.animation.Animation(new dojo.math.curves.Line(from, to), duration, 0); 
    442                                         var node = component; 
    443                                         dojo.event.connect(anim, "onAnimate", function(e) { 
    444                                                 node.style.color = "rgb(" + e.coordsAsInts().join(",") + ")"; 
    445                                         }); 
    446                                         anim.play(true); 
     438                    var node = component; 
     439                    var from = new dojo.gfx.color.Color(action.from); 
     440                    var to = new dojo.gfx.color.Color(action.to); 
     441 
     442                    var anim = new dojo.lfx.propertyAnimation(node, 
     443                        { "background-color": { start: from, end: to } }, 
     444                            duration, 
     445                            0, 
     446                        { 
     447                            "beforeBegin": function(){ 
     448                                node.style.backgroundColor = "rgb(" + from.toRgb().join(",") + ")"; 
     449                            } 
     450                        } 
     451                    ); 
     452                     
     453                    anim.play(true); 
    447454                                }else if(tmpAction == "bgcolor"){ 
    448455                                        dojo.lfx.html.unhighlight(component, action.to, duration).play();