aboutsummaryrefslogtreecommitdiffstats
path: root/src/traversing.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/traversing.js')
-rw-r--r--src/traversing.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/traversing.js b/src/traversing.js
index e3fc5cfa2..943d16cb6 100644
--- a/src/traversing.js
+++ b/src/traversing.js
@@ -111,12 +111,11 @@ jQuery.fn.extend({
},
add: function( selector, context ) {
- var set = typeof selector === "string" ?
- jQuery( selector, context ) :
- jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
- all = jQuery.merge( this.get(), set );
-
- return this.pushStack( jQuery.unique(all) );
+ return this.pushStack(
+ jQuery.unique(
+ jQuery.merge( this.get(), jQuery( selector, context ) )
+ )
+ );
},
addBack: function( selector ) {