Skip to main content

Bug Tracker

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:

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 addyosmani comment:1


Changed January 01, 2011 07:35PM UTC by rwaldron comment:2

component: unfiledevent
owner: → rwaldron
priority: undecidedlow
status: newassigned

Changed March 14, 2011 12:17AM UTC by rwaldron comment:3

priority: lowhigh

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 dmethvin comment:4

resolution: → fixed
status: assignedclosed

Landed pull 159.