Side navigation
#9393 closed enhancement (fixed)
Opened May 22, 2011 07:15PM UTC
Closed September 20, 2011 12:52PM UTC
Last modified March 08, 2012 11:59PM UTC
Unify and DRY out event system
Reported by: | dmethvin | Owned by: | dmethvin |
---|---|---|---|
Priority: | high | Milestone: | 1.7 |
Component: | event | Version: | 1.6.1 |
Keywords: | 1.7-discuss | Cc: | |
Blocked by: | Blocking: |
Description
Unify and DRY out event system: jQuery.fn.on(events, [, selector ] [, data ], handler) -- see https://docs.google.com/document/d/1vzJ_pl_bCKAisHu15DhTQkJBNGvgycW35lJW45d9P6U/edit?hl=en
Attachments (0)
Change History (16)
Changed May 22, 2011 07:27PM UTC by comment:1
keywords: | → 1.7-discuss |
---|
Changed May 22, 2011 08:31PM UTC by comment:2
+1, Absolutely.
Changed May 23, 2011 01:04AM UTC by comment:3
+1,
Changed May 23, 2011 05:07AM UTC by comment:4
+1, yes
Changed May 24, 2011 12:58AM UTC by comment:5
component: | unfiled → event |
---|---|
milestone: | 1.next → 1.7 |
priority: | undecided → high |
status: | new → open |
Changed May 24, 2011 10:24PM UTC by comment:6
+1, Genius!
Changed June 03, 2011 02:10PM UTC by comment:7
+1, Good idea!
Changed June 03, 2011 03:52PM UTC by comment:8
+1!
Changed June 04, 2011 04:27PM UTC by comment:9
owner: | → dmethvin |
---|---|
status: | open → assigned |
Changed June 04, 2011 10:18PM UTC by comment:10
+1
Changed June 05, 2011 02:00PM UTC by comment:11
_comment0: | Not sure if these even needs to be addressed, possibly only documented, but some might expect `trigger` to work on events added this way, but trigger doesn't really work with event delegation. Could cause some confusion that trigger works with `el.on('click', fn)` but not with `el.on('click', 'li > a', fn)`. \ \ MooTools delegates by parsing the event name with a CSS style pseudo selector. So something like el.on('click:relay(li > a)', fn). \ \ Makes for a simpler signature and then you could trigger 'click:relay(li > a)' and pass in a fake target to get trigger to work with this unified system, even with delegation. Just a thought, but I don't think it's all that important /shrug \ \ \ → 1307285280627322 |
---|
Not sure if this even needs to be addressed, possibly only documented, but some might expect trigger
to work on events added this way, but trigger doesn't really work with event delegation. Could cause some confusion that trigger works with el.on('click', fn)
but not with el.on('click', 'li > a', fn)
.
MooTools delegates by parsing the event name with a CSS style pseudo selector. So something like el.on('click:relay(li > a)', fn).
Makes for a simpler signature and then you could trigger 'click:relay(li > a)' and pass in a fake target to get trigger to work with this unified system, even with delegation. Just a thought, but I don't think it's all that important /shrug
Changed June 05, 2011 10:14PM UTC by comment:12
+1 BLAMMO
Changed June 06, 2011 03:36PM UTC by comment:13
+1, we added something simliar in jQuery UI recently; will this support a hash of event types and handlers as well?
Changed August 11, 2011 03:46AM UTC by comment:14
Hot, Prototype-style, +1.
Changed August 11, 2011 01:55PM UTC by comment:15
@gf3, the history of .on
goes back to prehistoric days, I didn't realize Prototype had done it until after I had come up with the proposal. It's good to have some consistency across frameworks though.
Changed September 20, 2011 12:52PM UTC by comment:16
resolution: | → fixed |
---|---|
status: | assigned → closed |
Landed for 1.7.
Nominating ticket for 1.7 discussion.