Bug Tracker

Opened 9 years ago

Last modified 8 years ago

#6903 closed enhancement

special events need a way to determine whether they are being bound with .bind vs .live/.delegate — at Version 6

Reported by: cowboy Owned by:
Priority: blocker Milestone: 1.7
Component: event Version: 1.4.2
Keywords: special, event, live, bind, 1.7-discuss Cc: cowboy, SlexAxton
Blocked by: Blocking:

Description (last modified by Rick Waldron)

The solution could be as simple as a flag, or yet another function argument, but .setup, .add, .teardown, and .remove should all have some way of knowing whether they are being called via .bind vs .live/.delegate.

I've made some attempts at inference here (view the console): http://jsfiddle.net/cowboy/f5rkz/

But that's clearly less than ideal, especially when you need to maintain a cache of elements internally, like in this example (imagine trying to make this work for both .live/.delegate AND .bind): http://benalman.com/news/2010/03/jquery-special-events/#event-delegation

Change History (6)

comment:1 Changed 9 years ago by dmethvin

Component: unfiledevent
Type: bugenhancement

Do you have some examples where it would be convenient to have that info? I'm not familiar enough with the special events interface to know. For a case like jQuery.event.special.submit it's enough to know that the element handling the event isn't a form, but maybe that's the exception rather than the rule.

comment:2 Changed 9 years ago by SlexAxton

Cc: cowboy SlexAxton added
Keywords: special event live bind added
Milestone: 1.4.31.5
Priority: low
Status: newopen

Ben, I know you can patch this in. Wannadoit?

comment:3 Changed 9 years ago by cowboy

What I'm going to do first is try to implement this plugin in a way that works for both bind and live/delegate:

http://benalman.com/news/2010/03/jquery-special-events/#delegation-clickoutside

After that, I'll see what, if anything, needs to be done.

comment:4 Changed 8 years ago by john

Milestone: 1.next

A reduced test case would be good. Going to bring this up in the 1.7 roadmap meeting - your input would be good, cowboy!

comment:5 Changed 8 years ago by john

Keywords: 1.7-discuss added

Nominating ticket for 1.7 discussion.

comment:6 Changed 8 years ago by Rick Waldron

Description: modified (diff)

+1,

Note: See TracTickets for help on using tickets.