Fix #13846: .prev sort direction

This commit is contained in:
Richard Gibson 2013-05-01 11:33:06 -04:00
parent 18cccd04a6
commit 9c4a428528
2 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,5 @@
var isSimple = /^.[^:#\[\.,]*$/,
rparentsprev = /^(?:parents|prev(?:Until|All))/,
rneedsContext = jQuery.expr.match.needsContext,
// methods guaranteed to produce a unique set when starting from a unique set
guaranteedUnique = {
@ -200,8 +201,8 @@ jQuery.each({
jQuery.unique( matched );
}
// Reverse order for parents* and prev*
if ( name[ 0 ] === "p" && name !== "parent" ) {
// Reverse order for parents* and prev-derivatives
if ( rparentsprev.test( name ) ) {
matched.reverse();
}
}

View File

@ -682,7 +682,7 @@ test("sort direction", function() {
parents: true,
parentsUntil: true,
next: false,
prev: true,
prev: false,
nextAll: false,
prevAll: true,
nextUntil: false,