Cheers.
thanks.
On Mar 12, 10:41 am, Christophe Porteneuve <[EMAIL PROTECTED]> wrote:
> Hey,
>
> Since there currently is no cancel/stop facility in Form.Observer, your
> only shot is to use some variable accessible by your callback, that
> toggles it off after the first shot, e.g.
>
> var formChanged = function() {
> if (arguments.callee.notAnymore) return;
> // ...
> arguments.callee.notAnymore = true;}
>
> formChanged.prototype.notAnymore = false;
>
> new Form.Observer('formId', 2, formChanged);
>
> (yes, function prototypes can be used to store "function-static"
> variables... You'll see this trick here and there in Prototype's source
> code).
>
> --
> Christophe Porteneuve a.k.a. TDD
> "[They] did not know it was impossible, so they did it." --Mark Twain
> Email: [EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---