[Proto-Scripty] Re: Implementing something like jQuery's "oneClick" in Prototype?

2008-10-23 Thread Keith Hughitt
Thanks everyone for the suggestions. kangax's function fit the job perfectly. --~--~-~--~~~---~--~~ 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-scripta

[Proto-Scripty] Re: Implementing something like jQuery's "oneClick" in Prototype?

2008-10-22 Thread kangax
On Oct 22, 9:48 am, Keith Hughitt <[EMAIL PROTECTED]> wrote: > Could anyone help tell me what I'm missing? > > I could have sworn Prototype already had something like this (a > function that fires only once and then removes itself), but I couldn't > find it anywhere so I went about writing the cod

[Proto-Scripty] Re: Implementing something like jQuery's "oneClick" in Prototype?

2008-10-22 Thread Trevan Richins
Keith Hughitt wrote: > Could anyone help tell me what I'm missing? > > I could have sworn Prototype already had something like this (a > function that fires only once and then removes itself), but I couldn't > find it anywhere so I went about writing the code myself. > > First I tried to do it b

[Proto-Scripty] Re: Implementing something like jQuery's "oneClick" in Prototype?

2008-10-22 Thread lfortin
Hi Keith, When you call Event#stopObserving, you have to use the exact same handler that was used for Event#observe. I have not tested it, but try something like this: var myHandlerObj = { handler: function(e) { Event.stopObserving(this, 'click', myHandlerObj.boundHandler); } } myHa