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:
586e368
)
Fixed a bug with how pushStack was checking for arrays.
author
John Resig
<jeresig@gmail.com>
Thu, 6 Jul 2006 20:48:38 +0000
(20:48 +0000)
committer
John Resig
<jeresig@gmail.com>
Thu, 6 Jul 2006 20:48:38 +0000
(20:48 +0000)
jquery/jquery.js
patch
|
blob
|
history
diff --git
a/jquery/jquery.js
b/jquery/jquery.js
index
95afaa5
..
6f1cd8d
100644
(file)
--- a/
jquery/jquery.js
+++ b/
jquery/jquery.js
@@
-51,7
+51,7
@@
function jQuery(a,c) {
return new jQuery(a,c);
// Watch for when an array is passed in
return new jQuery(a,c);
// Watch for when an array is passed in
- this.pushStack( a.constructor == Array ?
+ this.get( a.constructor == Array ?
// Assume that it's an array of DOM Elements
a :
// Assume that it's an array of DOM Elements
a :
@@
-275,9
+275,9
@@
jQuery.fn = jQuery.prototype = {
},
pushStack: function(a,args) {
},
pushStack: function(a,args) {
- var fn = args ? (args.constructor == Function ? args : args[args.length-1]) : function(){};
+ var fn = args[args.length-1];
- if ( !fn ) {
+ if ( !fn || fn.constructor != Function ) {
if ( !this.stack ) this.stack = [];
this.stack.push( this.get() );
this.get( a );
if ( !this.stack ) this.stack = [];
this.stack.push( this.get() );
this.get( a );