Regardless of the JS framework.  A closure is necessary for attaching
class methods to a particular instance and preserve the instance
reference via the "this" keyword.

http://www.javascriptkit.com/javatutors/closures.shtml

I thought Function.bind was pretty clean myself, but I guess you've
got the sweet tooth for the syntax.

--

http://positionabsolute.net



On Aug 3, 1:16 pm, Cédric <bertolini.ced...@gmail.com> wrote:
> Thanks. I'll use #bind instead of #bindAsEventListener from now on.
>
> Regarding the binding inelegancy, I'm a bit disappointed, but at least
> it's a good working solution to the problem.
>
> I guess Class#addMethods won't be of any help here?
--~--~---------~--~----~------------~-------~--~----~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to