Opened 7 years ago
Closed 6 years ago
#7883 closed enhancement (fixed)
.delegate (and .live) should accept false as the fn arg, like .bind
| Reported by: | cowboy | Owned by: | Rick Waldron |
|---|---|---|---|
| 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
Change History (4)
comment:1 Changed 7 years ago by
comment:2 Changed 7 years ago by
| Component: | unfiled → event |
|---|---|
| Owner: | set to Rick Waldron |
| Priority: | undecided → low |
| Status: | new → assigned |
comment:3 Changed 6 years ago by
| 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?
Note: See
TracTickets for help on using
tickets.

+1