Re: [Proto-Scripty] Re: Is there a way to DRY this up?

2010-12-23 Thread Richard Quadling
@TJ Yeah. I sort of noticed that. I like the observeAll mechanism. Very reusable. In PHP, I could ... if (!!fn || fn = function(){...}) { fn(); } sort of thing. Basically assign a value to a variable and evaluate the assignment. For closures, this is always true. Could this be done in JS?

Re: [Proto-Scripty] Re: Is there a way to DRY this up?

2010-12-23 Thread Walter Lee Davis
As usual, taking it to the space elevator! Thanks so much! Walter On Dec 23, 2010, at 10:21 AM, T.J. Crowder wrote: @Richard: Maybe something like ... ['keyup', 'click', 'focus', 'blur'].each(function(eventName){ $('filter').observe(eventName, function(evt){ this.fire('check:filter'); }