mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Traversing: restore jQuery push behavior in .find
Fixes gh-2370 Close gh-2848
This commit is contained in:
parent
5c01cb1cc4
commit
4d3050b3d8
@ -53,9 +53,8 @@ jQuery.filter = function( expr, elems, not ) {
|
||||
|
||||
jQuery.fn.extend( {
|
||||
find: function( selector ) {
|
||||
var i,
|
||||
var i, ret,
|
||||
len = this.length,
|
||||
ret = [],
|
||||
self = this;
|
||||
|
||||
if ( typeof selector !== "string" ) {
|
||||
@ -68,11 +67,13 @@ jQuery.fn.extend( {
|
||||
} ) );
|
||||
}
|
||||
|
||||
ret = this.pushStack( [] );
|
||||
|
||||
for ( i = 0; i < len; i++ ) {
|
||||
jQuery.find( selector, self[ i ], ret );
|
||||
}
|
||||
|
||||
return this.pushStack( len > 1 ? jQuery.uniqueSort( ret ) : ret );
|
||||
return len > 1 ? jQuery.uniqueSort( ret ) : ret;
|
||||
},
|
||||
filter: function( selector ) {
|
||||
return this.pushStack( winnow( this, selector || [], false ) );
|
||||
|
Loading…
Reference in New Issue
Block a user