From 1fd56558e02c49878526f7602beaec95aa9ba612 Mon Sep 17 00:00:00 2001 From: Mottie Date: Sun, 27 Apr 2014 11:09:23 -0500 Subject: [PATCH] show processing icon after 500ms delay --- js/jquery.tablesorter.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js index 826c0d7e..76af92b1 100644 --- a/js/jquery.tablesorter.js +++ b/js/jquery.tablesorter.js @@ -1030,7 +1030,13 @@ $table .unbind('sortBegin' + c.namespace + ' sortEnd' + c.namespace) .bind('sortBegin' + c.namespace + ' sortEnd' + c.namespace, function(e) { - ts.isProcessing(table, e.type === 'sortBegin'); + clearTimeout(c.processTimer); + ts.isProcessing(table); + if (e.type === 'sortBegin') { + c.processTimer = setTimeout(function(){ + ts.isProcessing(table, true); + }, 500); + } }); }