Bug Tracker

Opened 9 years ago

Closed 8 years ago

#8981 closed feature (wontfix)

Support for array of types in bind, unbind, live, die, delegate, undelegate.

Reported by: Robert Katić Owned by:
Priority: low Milestone: 1.7
Component: event Version: 1.6rc1
Keywords: Cc:
Blocked by: Blocking:

Description (last modified by Rick Waldron)

See discussion starting at https://github.com/jquery/jquery/pull/77#issuecomment-1002880

This is mostly to make API more consistent with next changes?

Patch: https://github.com/jquery/jquery/pull/349

Change History (14)

comment:1 Changed 9 years ago by timmywil

Component: unfiledevent
Priority: undecidedlow
Status: newopen

@rkatic: I think we were thinking of writing a wrapper function that works like jQuery.access for all of the functions that need this feature to dry up the code. Also, I believe the event module will be majorly refined in 1.7 so the patch you've made may not be workable when that comes around.

comment:2 in reply to:  1 Changed 9 years ago by Robert Katić

@timmywil: I am not convinced to introduce a wrapper function like jQuery.access. Event methods can handle plain objects too, but attr/removeAttr/data/removeData will probably not.

Something more then this would be probably an overhead or require more changes then needed:

jQuery.words = function( obj ) {
  if ( typeof obj === "string" ) {
    return obj.split( rspaces );
  return obj || [];

My patch was more an intention to demonstrate how such feature would be easy to introduce, specially without a function like jQuery.access.

Last edited 9 years ago by Robert Katić (previous) (diff)

comment:3 Changed 9 years ago by timmywil

It's true. I wasn't saying your code is not good. It just may not fit at this time. I could very well be wrong, but considering that quite a bit will be changing, I think we will be able to reduce the overhead, which would be the point of having a wrapper function similar to access. By the way, this would not really apply to attr and data as we can't really set or get attributes and data with space-separated lists or arrays of keys. It would apply to removeAttr/removeData/unbind/die/undelegate. My thought was if DaveMethvin goes through with changes that have been discussed for event.js, this could all be quite clean.

comment:4 Changed 8 years ago by john

Keywords: 1.7-discuss added

Nominating ticket for 1.7 discussion.

comment:5 Changed 8 years ago by Rick Waldron

Description: modified (diff)

-1, This seems like a lot of repetitious code to accomplish something that could easily be accomplished by the user

comment:6 Changed 8 years ago by Robert Katić

Please note that this feature is more about future API consistency since #5479 and #7323 will be likely accepted by voting (https://spreadsheets.google.com/ccc?key=tm2LK6e1VAHCEJyw4rsspWg).

Last edited 8 years ago by Robert Katić (previous) (diff)

comment:7 Changed 8 years ago by jaubourg

-1, what is the gain?

comment:8 Changed 8 years ago by timmywil

+0, Not sure this will be needed.

comment:9 Changed 8 years ago by Robert Katić

I don't think there is any gain, except that it would allow something more programmatic binding (so not too relevant). I am not sure, but maybe this feature would be expected by the user once #5479 and #7323 will be applied.

So yea, if you ask to me I also would give a +0 to this.

Last edited 8 years ago by Robert Katić (previous) (diff)

comment:10 Changed 8 years ago by dmethvin

Description: modified (diff)

-1, Not sure where this is useful, and I'm not a fan of bloat caused by consistency that nobody needs.

comment:11 Changed 8 years ago by john

Description: modified (diff)

-1, Not really keen on this.

comment:12 Changed 8 years ago by ajpiano

Description: modified (diff)

+0, Don't see the need to apply a special case to everything else...

comment:13 Changed 8 years ago by scottgonzalez

Description: modified (diff)


comment:14 Changed 8 years ago by Rick Waldron

Description: modified (diff)
Keywords: 1.7-discuss removed
Milestone: 1.next1.7
Resolution: wontfix
Status: openclosed
Note: See TracTickets for help on using tickets.