mirror of
https://github.com/jquery/jquery.git
synced 2026-02-02 17:15:09 -05:00
Moved a bunch of methods out of the jQuery-specific Sizzle code into more-appropriate files, in jQuery itself.
This commit is contained in:
@@ -998,67 +998,6 @@ var posProcess = function(selector, context){
|
||||
jQuery.find = Sizzle;
|
||||
jQuery.expr = Sizzle.selectors;
|
||||
jQuery.expr[":"] = jQuery.expr.filters;
|
||||
|
||||
Sizzle.selectors.filters.hidden = function(elem){
|
||||
var width = elem.offsetWidth, height = elem.offsetHeight,
|
||||
force = /^tr$/i.test( elem.nodeName ); // ticket #4512
|
||||
return ( width === 0 && height === 0 && !force ) ?
|
||||
true :
|
||||
( width !== 0 && height !== 0 && !force ) ?
|
||||
false :
|
||||
!!( jQuery.curCSS(elem, "display") === "none" );
|
||||
};
|
||||
|
||||
Sizzle.selectors.filters.visible = function(elem){
|
||||
return !Sizzle.selectors.filters.hidden(elem);
|
||||
};
|
||||
|
||||
Sizzle.selectors.filters.animated = function(elem){
|
||||
return jQuery.grep(jQuery.timers, function(fn){
|
||||
return elem === fn.elem;
|
||||
}).length;
|
||||
};
|
||||
|
||||
jQuery.filter = jQuery.multiFilter = function( expr, elems, not ) {
|
||||
if ( not ) {
|
||||
expr = ":not(" + expr + ")";
|
||||
}
|
||||
|
||||
return Sizzle.matches(expr, elems);
|
||||
};
|
||||
|
||||
jQuery.dir = function( elem, dir ){
|
||||
var matched = [], cur = elem[dir];
|
||||
while ( cur && cur != document ) {
|
||||
if ( cur.nodeType == 1 )
|
||||
matched.push( cur );
|
||||
cur = cur[dir];
|
||||
}
|
||||
return matched;
|
||||
};
|
||||
|
||||
jQuery.nth = function(cur, result, dir, elem){
|
||||
result = result || 1;
|
||||
var num = 0;
|
||||
|
||||
for ( ; cur; cur = cur[dir] )
|
||||
if ( cur.nodeType == 1 && ++num == result )
|
||||
break;
|
||||
|
||||
return cur;
|
||||
};
|
||||
|
||||
jQuery.sibling = function(n, elem){
|
||||
var r = [];
|
||||
|
||||
for ( ; n; n = n.nextSibling ) {
|
||||
if ( n.nodeType == 1 && n != elem )
|
||||
r.push( n );
|
||||
}
|
||||
|
||||
return r;
|
||||
};
|
||||
|
||||
jQuery.unique = Sizzle.uniqueSort;
|
||||
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user