From 1393f9eea0e4e2e2120873e0a25fd2b39ca000f4 Mon Sep 17 00:00:00 2001 From: Fuzzwah Date: Mon, 5 Oct 2015 07:06:07 +1100 Subject: [PATCH] initial click on a header uses sortInitialOrder Behavior before this change: 1) click header_X, table is resorted by header_X_col in sortInitialOrder 2) click header_Y, table is resorted by header_Y_col in sortInitialOrder 3) click header_X again, table is resorted by header_X_col in opposite of sortInitialOrder 4) click header_Y again, table is resorted by header_Y_col in opposite of sortInitialOrder Behavior after this change: 1) click header_X, table is resorted by header_X_col in sortInitialOrder 2) click header_Y, table is resorted by header_Y_col in sortInitialOrder 3) click header_X again, table is resorted by header_X_col in sortInitialOrder 3) click header_Y again, table is resorted by header_Y_col in sortInitialOrder --- jquery.tablesorter.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jquery.tablesorter.js b/jquery.tablesorter.js index c5eabf0..fb59e66 100644 --- a/jquery.tablesorter.js +++ b/jquery.tablesorter.js @@ -733,7 +733,10 @@ this.order = this.count++ % 2; // always sort on the locked order. if(this.lockedOrder) this.order = this.lockedOrder; - + // set every other header back to the default initial sort order + $headers.not($cell).each( function() { + this.count = formatSortingOrder(config.sortInitialOrder); + }); // user only whants to sort on one // column if (!e[config.sortMultiSortKey]) {