mirror of
https://github.com/jquery/jquery.git
synced 2024-10-05 11:34:18 +00:00
Added code to short-circuit a .each() loop.
This commit is contained in:
parent
96d429b940
commit
edb54ef733
4
src/jquery/jquery.js
vendored
4
src/jquery/jquery.js
vendored
@ -1384,10 +1384,10 @@ jQuery.extend({
|
||||
each: function( obj, fn, args ) {
|
||||
if ( obj.length == undefined )
|
||||
for ( var i in obj )
|
||||
fn.apply( obj[i], args || [i, obj[i]] );
|
||||
if ( fn.apply( obj[i], args || [i, obj[i]] ) === false ) break;
|
||||
else
|
||||
for ( var i = 0; i < obj.length; i++ )
|
||||
fn.apply( obj[i], args || [i, obj[i]] );
|
||||
if ( fn.apply( obj[i], args || [i, obj[i]] ) === false ) break;
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user