Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix for #806
  • Loading branch information
jzaefferer committed Jan 17, 2007
1 parent 53e1275 commit 3362ccf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/jquery/coreTest.js
Expand Up @@ -34,7 +34,7 @@ test("get(Number)", function() {

test("add(String|Element|Array)", function() {
isSet( $("#sndp").add("#en").add("#sap").get(), q("sndp", "en", "sap"), "Check elements from document" );

isSet( $("#sndp").add( $("#en")[0] ).add( $("#sap") ).get(), q("sndp", "en", "sap"), "Check elements from document" );
ok( $([]).add($("#form")[0].elements).length > 13, "Check elements from array" );

var x = $([]).add($("<p id='x1'>xxx</p>")).add($("<p id='x2'>xxx</p>"));
Expand Down
2 changes: 1 addition & 1 deletion src/jquery/jquery.js
Expand Up @@ -985,7 +985,7 @@ jQuery.fn = jQuery.prototype = {
add: function(t) {
return this.pushStack( jQuery.merge(
this.get(),
typeof t == "string" ? jQuery(t).get() : t )
typeof t == "string" ? jQuery(t).get() : t.length ? t : [t] )
);
},

Expand Down

0 comments on commit 3362ccf

Please sign in to comment.