From fa419d7db9f87efe1908eaeedac05a495177a6b6 Mon Sep 17 00:00:00 2001 From: Mottie Date: Sat, 22 Dec 2012 10:05:46 -0600 Subject: [PATCH] Fixed sortReset bug - issue #167 --- js/jquery.tablesorter.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js index 7735e2ea..44409320 100644 --- a/js/jquery.tablesorter.js +++ b/js/jquery.tablesorter.js @@ -454,8 +454,7 @@ } function updateHeaderSortCount(table, list) { - var s, o, c = table.config, - l = c.headerList.length, + var s, t, o, c = table.config, sl = list || c.sortList; c.sortList = []; $.each(sl, function(i,v){ @@ -465,7 +464,8 @@ o = c.headerList[s[0]]; if (o) { // prevents error if sorton array is wrong c.sortList.push(s); - o.count = s[1] % (c.sortReset ? 3 : 2); + t = $.inArray(s[1], o.order); // fixes issue #167 + o.count = t >= 0 ? t : s[1] % (c.sortReset ? 3 : 2); } }); }