Skip to main content

Bug Tracker

Side navigation

Ticket #2811: add.diff
File add.diff, 0.7 KB (added by flesler, May 07, 2008 12:19AM UTC)
Index: core.js
===================================================================
--- core.js	(revision 5481)
+++ core.js	(working copy)
@@ -339,12 +339,12 @@
 	},
 
 	add: function( selector ) {
-		return !selector ? this : this.pushStack( jQuery.merge( 
+		return this.pushStack( jQuery.unique( jQuery.merge( 
 			this.get(),
-			selector.constructor == String ? 
-				jQuery( selector ).get() :
-				selector.length != undefined && (!selector.nodeName || jQuery.nodeName(selector, "form")) ?
-					selector : [selector] ) );
+			typeof selector == 'string' ? 
+				jQuery( selector ) :
+				jQuery.makeArray( selector )
+		)));
 	},
 
 	is: function( selector ) {

Download in other formats:

Original Format