From b1206a4109d3b13b06c3116ef3a2dd6c9e125a1f Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 23 Jul 2012 22:22:49 -0500 Subject: Enable filtering of todolist packages This matches the filtering options we have on the signoffs and package differences pages. Signed-off-by: Dan McGee --- sitestatic/archweb.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'sitestatic') diff --git a/sitestatic/archweb.js b/sitestatic/archweb.js index b04b1d01..e6d73414 100644 --- a/sitestatic/archweb.js +++ b/sitestatic/archweb.js @@ -279,6 +279,29 @@ function todolist_flag() { return false; } +function filter_todolist() { + /* start with all rows, and then remove ones we shouldn't show */ + var rows = $('#dev-todo-pkglist tbody').children(); + var all_rows = rows; + /* apply the filters, cheaper ones first */ + if ($('#id_mine_only').is(':checked')) { + rows = rows.filter('.mine'); + } + if ($('#id_incomplete').is(':checked')) { + rows = rows.has('.incomplete'); + } + /* hide all rows, then show the set we care about */ + all_rows.hide(); + rows.show(); + /* make sure we update the odd/even styling from sorting */ + $('.results').trigger('applyWidgets'); +} +function filter_todolist_reset() { + $('#id_incomplete').removeAttr('checked'); + $('#id_mine_only').removeAttr('checked'); + filter_todolist(); +} + /* signoffs.html */ function signoff_package() { var link = this; -- cgit v1.2.3-2-g168b