On Oct 2, 6:15 pm, "Lea Hayes" <[EMAIL PROTECTED]> wrote:
> Or as puckpuck suggested with the 'descendants' method instead of the
> CSS selector for greatly improved performance.
`Element.descendants` uses `Element.select` internally. That's why I
used `select` directly (to avoid an extra function call). `_each` is
there to avoid try/catch which is not really needed as far as I can
see. Also, passing `Event.stopObserving` as an iterator avoids an
extra function : )
>
> 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
--
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
-~----------~----~----~----~------~----~------~--~---