PDA

View Full Version : One handler for several events?



g2mac
15 Jan 2010, 3:10 AM
Hallo!

Is there a short version for:

el.on({
'click': handler,
'keydown': handler,
'someevent': handler
})
?
For example:

el.on('click keydown someevent',handler)

Animal
15 Jan 2010, 3:15 AM
addListener does not go to the computational expense of splitting the event string on spaces, and iterating over the results.

You could add a wrapper to do this if you thought it worthwhile.

I'm not sure there is a large enough use case to justify it.

g2mac
15 Jan 2010, 6:57 AM
Ok, it's clear. Thanks!