Side navigation
#7883 closed enhancement (fixed)
Opened January 01, 2011 05:26PM UTC
Closed April 06, 2011 02:02AM UTC
.delegate (and .live) should accept false as the fn arg, like .bind
| Reported by: | cowboy | Owned by: | rwaldron | 
|---|---|---|---|
| Priority: | high | Milestone: | 1.6 | 
| Component: | event | Version: | 1.4.4 | 
| Keywords: | Cc: | ||
| Blocked by: | Blocking: | 
Description
Just like .bind, .delegate (and .live) should accept false as a shortcut for function(){return false;}.
That way, someone could just do something like this to stop the original .live selector from matching just the "a" elements, instead of having to write a huge, complicated patch. :P
$('a,form').live( 'click', fn ); // pre-existing code
$('body').delegate( 'a', 'click', false ); // their code
Attachments (0)
Change History (4)
Changed January 01, 2011 06:58PM UTC by comment:1
Changed January 01, 2011 07:35PM UTC by comment:2
| component: | unfiled → event | 
|---|---|
| owner: | → rwaldron | 
| priority: | undecided → low | 
| status: | new → assigned | 
Changed March 14, 2011 12:17AM UTC by comment:3
| priority: | low → high | 
|---|
I'm changing this to "high" to ensure that it's added in 1.6 - simply for the sake of consistency... amirite?
Changed April 06, 2011 02:02AM UTC by comment:4
| resolution: | → fixed | 
|---|---|
| status: | assigned → closed | 
Landed pull 159.
+1