Commit 487567e8 authored by Ariel Flesler's avatar Ariel Flesler

jquery core: closes #2811, $.fn.add now calls $.unique internally, also it was...

jquery core: closes #2811, $.fn.add now calls $.unique internally, also it was failing for array-like f.e: window.
parent 407c5eb4
...@@ -337,12 +337,12 @@ jQuery.fn = jQuery.prototype = { ...@@ -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 ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment