diff options
author | Dan McGee <dan@archlinux.org> | 2010-09-01 07:39:57 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-09-01 07:39:57 -0500 |
commit | d7854ed8f1af5b203efad976c04a43f80b336a2b (patch) | |
tree | 300d5c1be15792ff7fde6c2bb6b4d23f14d66b41 | |
parent | d57696c8013d78f017972ae72efeeb441c954cb2 (diff) |
Make sort work on developer todo list status
Because it was a link, the sort didn't properly sort on the
complete/incomplete status when viewing a todo list. Add a custom parser to
fix it.
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | templates/todolists/view.html | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/templates/todolists/view.html b/templates/todolists/view.html index b5f9a320..504c8cbb 100644 --- a/templates/todolists/view.html +++ b/templates/todolists/view.html @@ -69,8 +69,20 @@ return false; }); }); +$.tablesorter.addParser({ + id: 'todostatus', + is: function(s) { return false; }, + format: function(s) { + return s.match(/incomplete/) ? 1 : 0; + }, + type: 'numeric' +}); $(document).ready(function() { - $(".results").tablesorter({widgets: ['zebra'], sortList: [[0,0], [1,0]]}); + $(".results").tablesorter({ + widgets: ['zebra'], + sortList: [[0,0], [1,0]], + headers: { 4: { sorter: 'todostatus' } } + }); }); </script> {% endblock %} |