Hello everyone,
I was just checking out some of my code to see if I could optimize it and I noticed that in event handlers the event.stop() method has to be called separately from all other code. Something I like about prototype is that a lot of methods can be chained like the Element methods (e.addClassName('bla').insert(foo).toggle().observe('click', bar).......).
But instead of returning the event, event.stop() returns 'undefined' making it impossible to do something like this:
var e = event.stop().findElement('a');
and forcing me to use 2 lines:
event.stop();
var e = event.findElement('a');
I've added 'return event;' at the bottom of the stop method in Event.Methods and it works perfectly (in FireFox, haven't tested in other browsers). Is it possible to make this small change? Or is there a reason why the event isn't returned?
Greetings,
Johan Arensman
--
You received this message because you are subscribed to the Google Groups "Prototype: Core" group.
To post to this group, send email to
prototy...@googlegroups.com
To unsubscribe from this group, send email to
prototype-cor...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/prototype-core?hl=en