source: [view]
if(!o.shape || !(o.type in this.overOutEvents)){ return; }
var runName = o.run.name, index = o.index, anim, startFill, endFill;
if(runName in this.anim){
anim = this.anim[runName][index];
}else{
this.anim[runName] = {};
}
if(anim){
anim.action.stop(true);
}else{
var color = o.shape.getFill();
if(!color || !(color instanceof dojo.Color)){
return;
}
this.anim[runName][index] = anim = {
start: color,
end: this.colorFun(color)
};
}
var start = anim.start, end = anim.end;
if(o.type == "onmouseout"){
// swap colors
var t = start;
start = end;
end = t;
}
anim.action = dojox.gfx.fx.animateFill({
shape: o.shape,
duration: this.duration,
easing: this.easing,
color: {start: start, end: end}
});
if(o.type == "onmouseout"){
dojo.connect(anim.action, "onEnd", this, function(){
if(this.anim[runName]){
delete this.anim[runName][index];
}
});
}
anim.action.play();