Fixed issue with .add()ing individual elements - and with .add()ing form elements (since they report a .length.
This commit is contained in:
parent
27c08b6544
commit
7b3ab69fcf
5
src/jquery/jquery.js
vendored
5
src/jquery/jquery.js
vendored
|
@ -985,7 +985,10 @@ jQuery.fn = jQuery.prototype = {
|
||||||
add: function(t) {
|
add: function(t) {
|
||||||
return this.pushStack( jQuery.merge(
|
return this.pushStack( jQuery.merge(
|
||||||
this.get(),
|
this.get(),
|
||||||
typeof t == "string" ? jQuery(t).get() : t.length ? t : [t] )
|
t.constructor == String ?
|
||||||
|
jQuery(t).get() :
|
||||||
|
t.length != undefined && !t.nodeName ?
|
||||||
|
t : [t] )
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue