Commit 7c72f69e authored by Richard Gibson's avatar Richard Gibson

Fix #13846: .prev sort direction

(cherry picked from commit 9c4a4285)
parent a49693a5
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({
ret = jQuery.unique( ret );
}
// Reverse order for parents* and prev*
if ( name.charAt(0) === "p" && name !== "parent" ) {
// Reverse order for parents* and prev-derivatives
if ( rparentsprev.test( name ) ) {
ret = ret.reverse();
}
}
......
......@@ -682,7 +682,7 @@ test("sort direction", function() {
parents: true,
parentsUntil: true,
next: false,
prev: true,
prev: false,
nextAll: false,
prevAll: true,
nextUntil: false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment