Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fixed a loop that only worked in webkit.
- Loading branch information
jaubourg
authored and
unknown
committed
Dec 24, 2010
1 parent
116c82b
commit 56628c7
Showing
1 changed file
with
8 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -800,12 +800,14 @@ jQuery.extend({ | ||
deferred = { | ||
|
||
// then( f1, f2, ...) | ||
then: function() { | ||
then: function then() { | ||
|
||
if ( ! cancelled ) { | ||
|
||
var args = arguments, | ||
i, | ||
length, | ||
elem, | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jaubourg
Member
|
||
type, | ||
_fired; | ||
|
||
@@ -814,13 +816,13 @@ jQuery.extend({ | ||
fired = 0; | ||
} | ||
|
||
for ( i in args ) { | ||
i = args[ i ]; | ||
type = jQuery.type( i ); | ||
for ( i = 0, length = args.length ; i < length ; i++ ) { | ||
elem = args[ i ]; | ||
type = jQuery.type( elem ); | ||
if ( type === "array" ) { | ||
this.then.apply( this , i ); | ||
then.apply( this , elem ); | ||
} else if ( type === "function" ) { | ||
callbacks.push( i ); | ||
callbacks.push( elem ); | ||
} | ||
} | ||
|
||
Since
elem
isn't an element maybe it should be renamed tocallback
orobject
?