Ticket #6060 (assigned enhancement)
dojox.fx.sizeTo caching leads to stale parameter state
| Reported by: | guest | Owned by: | dante |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.4 |
| Component: | Dojox | Version: | 1.0 |
| Severity: | normal | Keywords: | |
| Cc: | ole.ersoy@… |
Description (last modified by dante) (diff)
Hi,
I just did a little experimentation, and to make a long story short, it seems that dojox.fx.sizeTo is caching parameters it gets from the node argument during the construction of the animation.
Suppose the width of the node is 400px when the node is passed to the dojox.fx.sizeTo(args) factory method. The resulting animation thinks that when this animation is played, the width of the target node should always be 400px before the animation starts. From what I can see, it even sets the width to 400px (If it were changed to say 800px) before the animation starts, and then plays the animation.
To me it seems that since the starting width and height come from the node at first, the animation should always check the width and height before animating, and use the current width and height This would enable the animation to be cached and reused. Right now it seems that the only way to refresh the starting parameters is to create a brand new animation. I'm assuming that's fine in most cases. From a usability point of view though, I think it's more intuitive to have the animation start with the current width and height of the node whenever play is called. This way the animation can be cached, which means less garbage collection for the browser, etc.
Thoughts?
Thanks, - Ole