git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
407c5eb
)
jquery core: closes #2811, $.fn.add now calls $.unique internally, also it was failin...
author
Ariel Flesler
<aflesler@gmail.com>
Thu, 8 May 2008 17:08:59 +0000
(17:08 +0000)
committer
Ariel Flesler
<aflesler@gmail.com>
Thu, 8 May 2008 17:08:59 +0000
(17:08 +0000)
src/core.js
patch
|
blob
|
history
diff --git
a/src/core.js
b/src/core.js
index
42fd8d4
..
a6d4c5f
100644
(file)
--- a/
src/core.js
+++ b/
src/core.js
@@
-337,12
+337,12
@@
jQuery.fn = jQuery.prototype = {
},
add: function( selector ) {
},
add: function( selector ) {
- return !selector ? this : this.pushStack( jQuery.merge(
+ return this.pushStack( jQuery.unique( jQuery.merge(
this.get(),
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 ) {
},
is: function( selector ) {