From d3e1b867e4262ad044a683678adf75cd72b79912 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 14 Jan 2011 15:18:36 -0600 Subject: Update tablesorter cache after clicking todo list status We didn't update this before, so sorting the last after checking off a few todos didn't work right, as it was using the old values. Fix it by adding a call to update; this can eventually be changed to the updateCell call commented out once I upgrade the minified tablesorter.js file. Signed-off-by: Dan McGee --- media/archweb.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'media') diff --git a/media/archweb.js b/media/archweb.js index cf8acd15..7a0d1dcc 100644 --- a/media/archweb.js +++ b/media/archweb.js @@ -14,7 +14,7 @@ if (typeof $.tablesorter !== 'undefined') { id: 'todostatus', is: function(s) { return false; }, format: function(s) { - return s.match(/incomplete/) ? 1 : 0; + return s.match(/incomplete/i) ? 1 : 0; }, type: 'numeric' }); @@ -149,6 +149,9 @@ function todolist_flag() { $(link).text('Incomplete').addClass( 'incomplete').removeClass('complete'); } + /* let tablesorter know the cell value has changed */ + /* newer version of tablesorter: $('.results').trigger('updateCell', $(link).parent('td')); */ + $('.results').trigger('update'); }); return false; } -- cgit v1.2.3-54-g00ecf