From 3362ccf3ddc20d787551ffdb441ae606a3d06630 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rn=20Zaefferer?= Date: Wed, 17 Jan 2007 13:24:44 +0000 Subject: [PATCH] Fix for #806 --- src/jquery/coreTest.js | 2 +- src/jquery/jquery.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js index 0f1e0f5..28ba007 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($("

xxx

")).add($("

xxx

")); diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index ca4051f..f756b67 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] ) ); }, -- 1.7.10.4