mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Fix #13846: .prev sort direction
This commit is contained in:
parent
18cccd04a6
commit
9c4a428528
@ -1,4 +1,5 @@
|
|||||||
var isSimple = /^.[^:#\[\.,]*$/,
|
var isSimple = /^.[^:#\[\.,]*$/,
|
||||||
|
rparentsprev = /^(?:parents|prev(?:Until|All))/,
|
||||||
rneedsContext = jQuery.expr.match.needsContext,
|
rneedsContext = jQuery.expr.match.needsContext,
|
||||||
// methods guaranteed to produce a unique set when starting from a unique set
|
// methods guaranteed to produce a unique set when starting from a unique set
|
||||||
guaranteedUnique = {
|
guaranteedUnique = {
|
||||||
@ -200,8 +201,8 @@ jQuery.each({
|
|||||||
jQuery.unique( matched );
|
jQuery.unique( matched );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reverse order for parents* and prev*
|
// Reverse order for parents* and prev-derivatives
|
||||||
if ( name[ 0 ] === "p" && name !== "parent" ) {
|
if ( rparentsprev.test( name ) ) {
|
||||||
matched.reverse();
|
matched.reverse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -682,7 +682,7 @@ test("sort direction", function() {
|
|||||||
parents: true,
|
parents: true,
|
||||||
parentsUntil: true,
|
parentsUntil: true,
|
||||||
next: false,
|
next: false,
|
||||||
prev: true,
|
prev: false,
|
||||||
nextAll: false,
|
nextAll: false,
|
||||||
prevAll: true,
|
prevAll: true,
|
||||||
nextUntil: false,
|
nextUntil: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user