> First of all, I disapprove of marking #6509 as fixed because it isn't, the
> patch is just superseded by another. You should have marked it as duplicate.

Roget that.  My bad, I'm still new to the Trac system..

> Second, I don't like breaking backwards compatibility with this additional
> first argument. The method calls are starting to look too complicated.

It doesn't break backwards compatibility, the original Event.observe 
and Event.stopObserving are still there, they call they new functions 
with the default key, Event.key.

> With the Event rewrite by Andrew and me you only need to know what elements 
> you
> added observers to and you can clean up like this:
>
>     elements.invoke(Event.stopObserving)
>
> While your "key" idea is not bad, I don't think we should go to those
> lengths just for better event handling.

While this is a great idea and I'd like to see it included, it doesn't 
provide functionality for what I was trying to achieve. I want to be 
able to clean up all events for a widget or whatever else without 
having to know what elements have observers, or even having to know 
what elements have been added or are related to what I'm trying to 
cleanup. With my approach, widgets, classes, etc.. can be extended 
without any more complexity added to cleanup.  I've already updated 
lots of my code to use this new system and it *really* cleans things 
up a lot. For simple things, it lets you not have to use 
this.someElement = ... and this.someListener = ...  since all you have 
to know is the key.  Now I overlooked this before, but "this" 
apparently isn't a good key as it seems that when used as a hash key 
it just evaluates to [object Object]. This doesn't change the 
usefulness of the new Event API, you just have to use something else 
for the key, such as the id of the main widget element.

Colin


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to