git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
96d429b
)
Added code to short-circuit a .each() loop.
author
John Resig
<jeresig@gmail.com>
Thu, 12 Oct 2006 16:37:01 +0000
(16:37 +0000)
committer
John Resig
<jeresig@gmail.com>
Thu, 12 Oct 2006 16:37:01 +0000
(16:37 +0000)
src/jquery/jquery.js
patch
|
blob
|
history
diff --git
a/src/jquery/jquery.js
b/src/jquery/jquery.js
index
9edd758
..
8332f64
100644
(file)
--- a/
src/jquery/jquery.js
+++ b/
src/jquery/jquery.js
@@
-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;
},