Ticket #8981 (closed feature: wontfix)
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?
Change History
comment:1 follow-up: ↓ 2 Changed 2 years ago by timmywil
- Priority changed from undecided to low
- Status changed from new to open
- Component changed from unfiled to event
comment:2 in reply to: ↑ 1 Changed 2 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.
comment:3 Changed 2 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 2 years ago by john
- Keywords 1.7-discuss added
Nominating ticket for 1.7 discussion.
comment:5 Changed 2 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 2 years ago by rkatic
Please note that this feature is more about future API consistency since #5479 and #7323 seams will be accepted by voting ( https://spreadsheets.google.com/ccc?key=tm2LK6e1VAHCEJyw4rsspWg).
comment:9 Changed 2 years ago by rkatic
comment:10 Changed 2 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:12 Changed 2 years ago by ajpiano
- Description modified (diff)
+0, Don't see the need to apply a special case to everything else...
comment:14 Changed 2 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
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

@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.