http://javascriptmvc.googlecode.com/svn/trunk/jquery/event/default/default.js
This way, you could have an acts as "tab" plugin do something like:
$(".tab").bind("hide", function(ev){
var el = this;
ev.addDefault(function(){
$(el).hide()
})
})
And allow you to do something like:
$(".tab").bind("hide", function(ev){
if(!CURRENT_TAB_COMPLETE) ev.preventDefault();
})
Somewhere else and prevent the "act as tab's" default behavior of
hiding the tab.
I think $.actsAs will allow you to wire up default functionality like:
$.actsAs("jupiter.tabs", {
"default .tab hide" : function(el, ev){
el.hide()
}
})
In your Controller:
$.controller('my.tabs', {
".tab hide" : function(el, ev){
if(!CURRENT_TAB_COMPLETE) ev.preventDefault();
}
})
Thoughts?
Currently, there might be a problem if you .preventDefault(). If
above your current delegated element, there is something waiting to
attach a default event, it will not have the opportunity. However, I
think this adds another important layer to JMVC.
http://forum.jquery.com/#Topic/14737000000658449
On Jan 23, 4:20 pm, Justin Meyer <justinbme...@gmail.com> wrote:
> Another idea to enable event based APIs to be more powerful is letting
> you have custom default events. I've just added a plugin to do that:
>
> http://javascriptmvc.googlecode.com/svn/trunk/jquery/event/default/de...