Bug Tracker

Ticket #8981 (closed feature: wontfix)

Opened 4 years ago

Last modified 3 years ago

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

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

Description (last modified by rwaldron) (diff)

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

comment:1 follow-up: ↓ 2 Changed 4 years ago by timmywil

  • Priority changed from undecided to low
  • Status changed from new to open
  • Component changed from unfiled to event

@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 4 years ago by rkatic

@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 4 years ago by rkatic (previous) (diff)

comment:3 Changed 4 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 3 years ago by john

  • Keywords 1.7-discuss added

Nominating ticket for 1.7 discussion.

comment:5 Changed 3 years ago by rwaldron

  • 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 3 years ago by rkatic

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 3 years ago by rkatic (previous) (diff)

comment:7 Changed 3 years ago by jaubourg

-1, what is the gain?

comment:8 Changed 3 years ago by timmywil

+0, Not sure this will be needed.

comment:9 Changed 3 years ago by rkatic

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 would give a +0 to this too.

Version 0, edited 3 years ago by rkatic (next)

comment:10 Changed 3 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 3 years ago by john

  • Description modified (diff)

-1, Not really keen on this.

comment:12 Changed 3 years ago by ajpiano

  • Description modified (diff)

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

comment:13 Changed 3 years ago by scott.gonzalez

  • Description modified (diff)

-1

comment:14 Changed 3 years ago by rwaldron

  • Keywords 1.7-discuss removed
  • Status changed from open to closed
  • Resolution set to wontfix
  • Description modified (diff)
  • Milestone changed from 1.next to 1.7
Note: See TracTickets for help on using tickets.