jQuery lets you do things like
$div.bind('click.namespace', function)
$div.unbind('click.namespace')
Is there any equivalent in MooTools? I tried defining a pseudo event:
Event.definePseudo('shim', function(split, fn, args) {fn.apply(this, args);})
document.body.addEvent('click', function(){alert('regular click');});
document.body.addEvent('click:shim', function(){alert('shim click');});
document.body.removeEvents('click') // removes both!
document.body.removeEvents('click:shim') // removes neither!
That seems like a dead end.
I implemented it using Element.implement, but my question is asking for a native MooTools way to do it, without defining my own functions.