mirror of
https://github.com/jquery/jquery.git
synced 2026-01-25 16:38:10 -05:00
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:
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 ) {
|
||||
|
||||
Reference in New Issue
Block a user