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
10
src/core.js
10
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 ?
|
typeof selector == 'string' ?
|
||||||
jQuery( selector ).get() :
|
jQuery( selector ) :
|
||||||
selector.length != undefined && (!selector.nodeName || jQuery.nodeName(selector, "form")) ?
|
jQuery.makeArray( selector )
|
||||||
selector : [selector] ) );
|
)));
|
||||||
},
|
},
|
||||||
|
|
||||||
is: function( selector ) {
|
is: function( selector ) {
|
||||||
|
|
Loading…
Reference in a new issue