Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
addDefault
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Justin Meyer  
View profile  
 More options Jan 23 2010, 5:20 pm
From: Justin Meyer <justinbme...@gmail.com>
Date: Sat, 23 Jan 2010 14:20:13 -0800 (PST)
Local: Sat, Jan 23 2010 5:20 pm
Subject: addDefault
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...

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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Justin Meyer  
View profile  
 More options Jan 23 2010, 5:26 pm
From: Justin Meyer <justinbme...@gmail.com>
Date: Sat, 23 Jan 2010 14:26:10 -0800 (PST)
Local: Sat, Jan 23 2010 5:26 pm
Subject: Re: addDefault
Added this on jQuery's forum.  Vote for it if you like it.

http://forum.jquery.com/#Topic/14737000000658449

On Jan 23, 4:20 pm, Justin Meyer <justinbme...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »