[dev] [cvs] commit: incubator/Horde_Form/js eventlistener.js

Chuck Hagenbuch chuck at horde.org
Sat Jul 30 10:48:48 PDT 2005


Quoting Matt Warden <mwarden at gmail.com>:

>  Added files:
>    Horde_Form/js        eventlistener.js
>  Log:
>  Saw this kind of code all over Horde's JS files, so just wrote a 
> couple functions to make things easier. I prefer the method used in 
> initBody with an array of functions, but I can't assume that there is 
> not already an attached listener, so I had to use the 'recursive' 
> method as well

Since you're being unobtrusive, don't need to generally go with the 
addObjectEventListener() method anyway? Given this, I'd encourage you 
to use the implementation in horde/js/form_helpers.js (the addEvent() 
function) instead, since it takes either a string of javascript or a 
function reference.

The only reason I haven't broken this out into a seperate file is the 
lack of "require" in javascript. Ideas on dealing with that are very 
welcome. :)

-chuck

-- 
"But she goes not abroad in search of monsters to destroy." - John 
Quincy Adams


More information about the dev mailing list