Skip to content
Permalink
Browse files

Fix #13846: .prev sort direction

  • Loading branch information...
gibson042 committed May 1, 2013
1 parent 18cccd0 commit 9c4a428528cc47b0ef87a273f191c0fbbccc9678
Showing with 4 additions and 3 deletions.
  1. +3 −2 src/traversing.js
  2. +1 −1 test/unit/traversing.js
@@ -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();
}
}
@@ -682,7 +682,7 @@ test("sort direction", function() {
parents: true,
parentsUntil: true,
next: false,
prev: true,
prev: false,
nextAll: false,
prevAll: true,
nextUntil: false,

0 comments on commit 9c4a428

Please sign in to comment.
You can’t perform that action at this time.