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 <dan@archlinux.org>
This commit is contained in:
Dan McGee 2011-01-14 15:18:36 -06:00
parent d666cf4aaf
commit d3e1b867e4

View File

@ -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;
}