From 61ae505facf66f6308049a376dcfb9aadc07ed1f Mon Sep 17 00:00:00 2001 From: Mottie Date: Fri, 24 May 2013 09:36:00 -0500 Subject: [PATCH] fix to filter optimization tweak (#313), when searching for exact matches --- js/jquery.tablesorter.widgets.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/jquery.tablesorter.widgets.js b/js/jquery.tablesorter.widgets.js index 5435387e..a79d42b5 100644 --- a/js/jquery.tablesorter.widgets.js +++ b/js/jquery.tablesorter.widgets.js @@ -416,6 +416,8 @@ ts.addWidget({ // check for changes from beginning of filter; but ignore if there is a logical "or" in the string searchFiltered = (val || '').indexOf(r[i] || '') === 0 && searchFiltered && !/(\s+or\s+|\|)/g.test(val || ''); }); + // can't search when all rows are hidden - this happens when looking for exact matches + if (searchFiltered && $tr.filter(':visible').length === 0) { searchFiltered = false; } // loop through the rows for (j = 0; j < l; j++){ r = $tr[j].className;