aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2007-01-17 13:24:44 +0000
committerJörn Zaefferer <joern.zaefferer@gmail.com>2007-01-17 13:24:44 +0000
commit3362ccf3ddc20d787551ffdb441ae606a3d06630 (patch)
treefda81a9023df716dc1cfb6d41f472fe6577e3493 /src
parent53e12752e00c2a86757ec15a0c871dee8ccd1bea (diff)
downloadjquery-3362ccf3ddc20d787551ffdb441ae606a3d06630.tar.gz
jquery-3362ccf3ddc20d787551ffdb441ae606a3d06630.zip
Fix for #806
Diffstat (limited to 'src')
-rw-r--r--src/jquery/coreTest.js2
-rw-r--r--src/jquery/jquery.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js
index 0f1e0f5a8..28ba00702 100644
--- a/src/jquery/coreTest.js
+++ b/src/jquery/coreTest.js
@@ -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>"));
diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js
index ca4051f3d..f756b67ab 100644
--- a/src/jquery/jquery.js
+++ b/src/jquery/jquery.js
@@ -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] )
);
},