From d54813d1fa62d972e5af376a6673e1374f87a669 Mon Sep 17 00:00:00 2001 From: Mottie Date: Fri, 26 Apr 2013 16:01:45 -0500 Subject: [PATCH] filter_liveSearch now works properly in non-webkit browsers; fixes #285 --- js/jquery.tablesorter.widgets.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/jquery.tablesorter.widgets.js b/js/jquery.tablesorter.widgets.js index d734cb72e..cb4d586da 100644 --- a/js/jquery.tablesorter.widgets.js +++ b/js/jquery.tablesorter.widgets.js @@ -583,16 +583,17 @@ ts.addWidget({ }) .find('input.' + css).bind('keyup search', function(e, filter){ // ignore arrow and meta keys; allow backspace - if (e.type === 'keyup' && ((e.which < 32 && e.which !== 8) || (e.which >= 37 && e.which <=40) || (e.which !== 13 && !wo.filter_liveSearch))) { return; } + if (e.type === 'keyup' && ((e.which < 32 && e.which !== 8 && wo.filter_liveSearch && e.which !== 13) || (e.which >= 37 && e.which <=40) || (e.which !== 13 && !wo.filter_liveSearch))) { return; } // skip delay if (typeof filter !== 'undefined' || filter === false){ checkFilters(); + // no return false; allow search event propogation up to table } else { // delay filtering clearTimeout(timer); timer = setTimeout(function(){ checkFilters(filter); - }, wo.filter_searchDelay); + }, wo.filter_liveSearch ? wo.filter_searchDelay : 10); return false; } });