Side navigation
#6238 closed enhancement (wontfix)
Opened March 07, 2010 05:20PM UTC
Closed April 16, 2011 09:12PM UTC
All "each" style callbacks should pass consistent arguments.
Reported by: | cowboy | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | effects | Version: | 1.4.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
logs what you'd expect.
$('*').each(function( i, elem ){ console.log( i, elem ); });
hey, it's an undefined party and everyone's invited!
$('*').fadeOut(function( i, elem ){ console.log( i, elem ); });
This metaphor is used in many, many places, and it should be consistent across jQuery.
In addition, I'd like to see a third argument passed, which is a reference to the initial collection being operated on - is that even possible?
Attachments (0)
Change History (6)
Changed March 07, 2010 05:22PM UTC by comment:1
Changed March 07, 2010 05:29PM UTC by comment:2
+1 for Ben's suggestion of passing the initial collection.
Changed June 12, 2010 03:26AM UTC by comment:3
component: | unfiled → core |
---|
Changed October 08, 2010 11:06PM UTC by comment:4
need: | Review → Patch |
---|---|
priority: | → undecided |
I agree that this behavior should be consistent. Moving to patch.
Changed October 15, 2010 10:15PM UTC by comment:5
milestone: | 1.4.3 |
---|---|
priority: | undecided → low |
status: | new → open |
type: | bug → enhancement |
version: | 1.4.2 → 1.4.3 |
Changed April 16, 2011 09:12PM UTC by comment:6
component: | core → effects |
---|---|
milestone: | → 1.next |
resolution: | → wontfix |
status: | open → closed |
I'm not completely convinced that it makes sense in this case - as it's not a synchronous loop - it's more akin to attaching an event that is fired when fadeOut is complete (and I don't think that events really make sense having this sort of thing).
I meant: