| @@ 3013-3040 (lines=28) @@ | ||
| 3010 | } ); |
|
| 3011 | }, |
|
| 3012 | ||
| 3013 | closest: function( selectors, context ) { |
|
| 3014 | var cur, |
|
| 3015 | i = 0, |
|
| 3016 | l = this.length, |
|
| 3017 | matched = [], |
|
| 3018 | pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? |
|
| 3019 | jQuery( selectors, context || this.context ) : |
|
| 3020 | 0; |
|
| 3021 | ||
| 3022 | for ( ; i < l; i++ ) { |
|
| 3023 | for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { |
|
| 3024 | ||
| 3025 | // Always skip document fragments |
|
| 3026 | if ( cur.nodeType < 11 && ( pos ? |
|
| 3027 | pos.index( cur ) > -1 : |
|
| 3028 | ||
| 3029 | // Don't pass non-elements to Sizzle |
|
| 3030 | cur.nodeType === 1 && |
|
| 3031 | jQuery.find.matchesSelector( cur, selectors ) ) ) { |
|
| 3032 | ||
| 3033 | matched.push( cur ); |
|
| 3034 | break; |
|
| 3035 | } |
|
| 3036 | } |
|
| 3037 | } |
|
| 3038 | ||
| 3039 | return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); |
|
| 3040 | }, |
|
| 3041 | ||
| 3042 | // Determine the position of an element within |
|
| 3043 | // the matched set of elements |
|
| @@ 2968-2995 (lines=28) @@ | ||
| 2965 | } ); |
|
| 2966 | }, |
|
| 2967 | ||
| 2968 | closest: function( selectors, context ) { |
|
| 2969 | var cur, |
|
| 2970 | i = 0, |
|
| 2971 | l = this.length, |
|
| 2972 | matched = [], |
|
| 2973 | pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? |
|
| 2974 | jQuery( selectors, context || this.context ) : |
|
| 2975 | 0; |
|
| 2976 | ||
| 2977 | for ( ; i < l; i++ ) { |
|
| 2978 | for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { |
|
| 2979 | ||
| 2980 | // Always skip document fragments |
|
| 2981 | if ( cur.nodeType < 11 && ( pos ? |
|
| 2982 | pos.index( cur ) > -1 : |
|
| 2983 | ||
| 2984 | // Don't pass non-elements to Sizzle |
|
| 2985 | cur.nodeType === 1 && |
|
| 2986 | jQuery.find.matchesSelector( cur, selectors ) ) ) { |
|
| 2987 | ||
| 2988 | matched.push( cur ); |
|
| 2989 | break; |
|
| 2990 | } |
|
| 2991 | } |
|
| 2992 | } |
|
| 2993 | ||
| 2994 | return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); |
|
| 2995 | }, |
|
| 2996 | ||
| 2997 | // Determine the position of an element within the set |
|
| 2998 | index: function( elem ) { |
|