Josh:
I believe the `e.element()` line should use `Event#findElement`
instead to walk the DOM tree up to find the first parent matching.
i.e.:
document.observe('click', function(e) {
if (e.findElement('.test')) {
console.log('clicked');
}
});
Luisgo:
I think it's definitely worth the effort, I've been personnally using
this pattern successfully in many applications.
In previous discussions, we ended up with the following signature:
`Element.delegate(@element, selector, eventName, callback)`
Then jQuery's `.live` query :
`$(selector).live(eventName, callback);
would become:
document.delegate(selector, eventName, callback);
IMO it should definitely be part of the framework.
Best,
Samuel.