Or as puckpuck suggested with the 'descendants' method instead of the
CSS selector for greatly improved performance.
Object.extend(Element.prototype, {
stopObservingNested: function() {
this.stopObserving();
this.descendants().each(function(el) {
el.stopObserving(); });
}
});
I have tested the above, and it appears to work fine.
Best regards,
Lea Hayes
2008/10/2 kangax <[EMAIL PROTECTED]>:
>
> On Oct 2, 9:57 am, labs <[EMAIL PROTECTED]> wrote:
>> Yeah, but if you firebug the Event object after recursive unregister, you
>> will see that every element that doesnt had a _prototypeEventID will create
>> an entry in Event.cache. This is because the way the eventId is generated
>> and THERE I'll not mess with :)
>>
>> Those entry are empty, I know, but ohhh... its damn ugly. ;)
>>
>> P.s. agreed with the 'stopObservingNested' thing.
>
> I believe something like this is enought:
>
> Element.Methods.purge = function(element) {
> element = $(element);
> [element].concat(element.select('*')))._each(Event.stopObserving);
> return element;
> }
>
>>
>> []'s
>> Labs
>
> --
> kangax
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---