[jQuery] Is there a way to define custom event default handler?
Is there a way to define custom event default handler?
jQuery.fn.bindDefault - this function does not exist, but it would be
nice to have such one to have ability to make equivalent of DOM
default event for custom events.
It have to work just like jQuery.fn.bind, but handlers passed to it
have to be applied after passed to jQuery.fn.bind and if(!
event.isDefaultPrevented()).
Example:
$("#Button")
.bind("custom",function(){alert("handler #1")})
.bindDefault("custom",function(){alert("default handler #1")})
.bindDefault("custom",function(){alert("default handler #2")})
.bind("custom",function(){alert("handler #2")})
.trigger("custom");
//Will alert handler #1, handler #2, default handler #1, default
handler #1.
P.S. Sorry for poor english