PDA

View Full Version : Prototype / JQuery highlight animation broken



jclawson
6 Jun 2007, 11:19 AM
The highlight animation which is used in the tree doesn't work when using the Prototype or JQuery adapters. Verified in the Ext Examples for both adapters.

tryanDLS
6 Jun 2007, 11:35 AM
Is this occurring with 1.0.1a or 1.1beta?

jclawson
6 Jun 2007, 11:46 AM
1.0.1a

I tried testing but it seems the beta has broken some tree code:


Line 18957 of ext-all-debug.js
var targetNode = this.node.ownerTree.innerCt.dom;

this.node.ownerTree.innerCt has no properties.



It looks like from 1.0.1a the offending tree code was changed from:
var targetNode = this.node.ownerTree.container.dom;
to
var targetNode = this.node.ownerTree.innerCt.dom;

If I change the line back to what it was in 1.0.1a everything seems to work fine. However, highlight does not work in 1.1 beta.

perrich
6 Jun 2007, 11:49 AM
It doesn't work with all version => for jQuery it's a bug in jQuery and/or jQuery-adapter. There are already posts for this same issue. jQuery doesn't contains a animated effect like highlight (but a plugin named "interface" can do that).

For Prototype, it doesn't work with 1.1beta.

jclawson
8 Jun 2007, 8:29 AM
I think the Fx class needs much TLC. It is far inferior to scriptaculous. Scriptaculous has a highlight function already. Fx should just use that. Also lets say you are fading out an element. In scriptaculous if you show that element while its in the middle of fading out, scriptaculous will stop the animation first and fade back in. Fx appears to create a new animation every time its run without regard to currently running animations.

Since Fx is very much dependent on whether you are using YUI, Prototype, or JQuery I think it needs to be brought into the adapter instead of relying on the very basic Ext.lib.Anim.

btw... I am using prototype / scriptaculous if anyone is keeping count

jack.slocum
8 Jun 2007, 9:15 PM
I think the Fx class needs much TLC. It is far inferior to scriptaculous. Scriptaculous has a highlight function already. Fx should just use that. Also lets say you are fading out an element.

I understand you may be used to scriptaculous, but that is a pretty bold statement. The Ext Fx has many *real world* features that scriptaculous doesn't/can't handle. e.g, auto blocking (a MUST have that no other effects package has), auto sequencing (not with a million nested functions), supports multiple element animations in a single call, etc.

Ext's Fx (like slide) also support many more types of element and positions than the scriptaculous equivalent which only goes 2 ways and only supports static positioned elements.


In scriptaculous if you show that element while its in the middle of fading out, scriptaculous will stop the animation first and fade back in. Fx appears to create a new animation every time its run without regard to currently running animations.

Fx will too, just pass stop:true and it will stop the current running Fx. Unlike scriptaculous, this is supported by all Fx. e.g. if you are running a slideIn and then call a fadeOut it will work too, it is not dependent on the type of Fx being the same.

---

To get back to the original problem, what the prototype adapter needs is a little love. It's needs someone with intimate knowledge of prototype to work on the issues when bridging between to the two libs.

JasonMichael
9 Jun 2007, 10:15 AM
Wow,that Fx sounds great. I think we just need to spend more time with it or at least I do, before thinking of using scriptaculous.... I plan to do some work with Fx soon (possibly this weekend).

Jason

IGx89
11 Jun 2007, 6:10 AM
I posted a patch (http://extjs.com/forum/showthread.php?t=7182) a little ways back to fix jQuery animation support in Ext 1.1b1; it worked great with Fx.frame, though I haven't actually tested it with Fx.highlight.

stever
11 Jun 2007, 1:50 PM
scriptaculous became popular because anyone could do something like pulsate or shake by just saying pulsate or shake. There is a value in named configuration sets as such...

jclawson
18 Jun 2007, 9:43 AM
I understand you may be used to scriptaculous, but that is a pretty bold statement. The Ext Fx has many *real world* features that scriptaculous doesn't/can't handle...

I am not by any means a scriptaculous fan, nor am I saying it is better than anything you can create. However, as is... for all prototype / JQuery users... the code doesn't really work 100%. Granted, what doesn't work isn't a show stopper but it is worth fixing. Additionally, your effects handling is not very configurable throughout Ext... ie the Tree expand/contract animations. It would be nice if you had scriptaculous style effects objects that could be passed into Ext objects as configuration parameters. So you could customize the tree animation for example. I would like to see the tree animation revert back to the YUI days where the top is fixed and the hieght is animated.

I do appreciate your auto blocking / auto sequencing. This usually requires you to hand off effects to an Effects queue in other libraries.

I personally hate scriptaculous and we don't use it anywhere else. My point here really is that for using Prototype you require the use of scriptaculous and not that much of scriptaculous is actually used. It seems a little like unnecessary code bloat. As soon as 1.1 is working, I will rip out the animation library from the standalone adapter and put it into my own custom adapter. Or hack in MooFx...

I appreciate all the work you are doing.