I haven't noticed anyone else pointing this out, but instead of doing:
Widget.implement(new Options, new Events)
do:
Widget = new Class({
Implements : [Options,Events]
...
...
});
On Sat, Apr 30, 2011 at 7:03 PM, Ryan Florence <[email protected]> wrote:
> I'd add that using self or that is totally fine, faster, and occasionally
> more elegant.
>
> Sent from my iPhone
>
> On Apr 30, 2011, at 9:30 AM, Christoph Pojer <[email protected]>
> wrote:
>
> > And to ease with that you can use Class.Binds from PowerTools!
> http://cpojer.net/PowerTools/#!
> >
> > this.bound('method') will always return the same reference, so you can
> do:
> >
> > element.addEvent('click', this.bound('clickHandler'));
> >
> > element.removeEvent('click', this.bound('clickHandler'));
> >
> > This circumvents manually defining a this.bound = {…} object.
>
--
Arieh Glazer
אריה גלזר
052-5348-561
http://www.arieh.co.il
http://www.link-wd.co.il