Bug Tracker

Ticket #6386 (closed enhancement: fixed)

Opened 5 years ago

Last modified 3 years ago

support data argument for live events via "event.special.live.add"

Reported by: mike.helgeson Owned by: dmethvin
Priority: low Milestone: 1.7
Component: event Version: 1.4.4
Keywords: live,1.7-discuss Cc:
Blocking: Blocked by:

Description (last modified by dmethvin) (diff)

I am attempting to support "live" events in a custom special event, and the data object passed in the "bind" method gets passed into my special event "setup" function. This allows accepting that argument as options. This does not work with the "live" method. The "data" property is correctly set in the "live" handler "event" object, but not passed into my special event "setup" function.

It is a very small change indeed. On line 2029 of jQuery 1.4.2,in the "jQuery.event.special.live.add" function, simply add the "handleObj.data" property as the fourth argument to "jQuery.event.add". Alternatively, this could be handled within the "jQuery.event.add" method.

As a side note. I think the "liveHandler" and "liveConvert" methods, which are currently private, should be moved to the "jQuery.event.special.live" object. This would allow plugins to leverage more of the "live" features for development. I would also be able to patch the previously mentioned issue within my special event plugin, but I cannot because "liveHandler" is private.

Change History

comment:1 Changed 4 years ago by snover

  • Milestone 1.4.3 deleted

Resetting milestone to future.

comment:2 Changed 4 years ago by snover

  • Status changed from new to open
  • Summary changed from "event.special.live.add" does not pass data argument to "event.add" to support data argument for live events via "event.special.live.add"
  • Priority set to low
  • Version changed from 1.4.2 to 1.4.4
  • Milestone set to 1.5
  • Type changed from bug to enhancement

If you provide a patch on GitHub, that will help to get this issue resolved more quickly.

comment:3 Changed 4 years ago by john

  • Milestone set to 1.next

Let's look at this for 1.7.

comment:4 Changed 4 years ago by john

  • Keywords live,1.7-discuss added; live removed

Nominating ticket for 1.7 discussion.

comment:5 Changed 4 years ago by rwaldron

  • Description modified (diff)

+1,

comment:6 Changed 4 years ago by jaubourg

+0,

comment:7 Changed 4 years ago by ajpiano

  • Description modified (diff)

+1,

comment:8 Changed 4 years ago by timmywil

  • Description modified (diff)

+1,

comment:9 Changed 4 years ago by dmethvin

  • Description modified (diff)

+1, on allowing data in delegated events, but not on exposing liveHandler etc because I'd like to rework that.

comment:10 Changed 4 years ago by john

  • Description modified (diff)

+1, Seems simple enough.

comment:11 Changed 4 years ago by scott.gonzalez

+1, sounds like a bug

comment:12 Changed 4 years ago by jzaefferer

+0

comment:13 Changed 3 years ago by dmethvin

  • Owner set to dmethvin
  • Status changed from open to assigned
  • Description modified (diff)
  • Milestone changed from 1.next to 1.7

comment:14 Changed 3 years ago by dmethvin

  • Status changed from assigned to closed
  • Resolution set to fixed

In 1.7 the data argument is available via handleObj.data. Determine whether the event is delegated or not by looking at handleObj.selector which will be undefined if it is not delegated.

Note: See TracTickets for help on using tickets.