jquery core: closes #2811, $.fn.add now calls $.unique internally, also it was failing for array-like f.e: window.
This commit is contained in:
parent
407c5eb430
commit
487567e82f
1 changed files with 5 additions and 5 deletions
10
src/core.js
10
src/core.js
|
@ -337,12 +337,12 @@ jQuery.fn = jQuery.prototype = {
|
|||
},
|
||||
|
||||
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 ) {
|
||||
|
|
Loading…
Reference in a new issue