diff options
author | Dan McGee <dan@archlinux.org> | 2014-03-09 12:02:00 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2014-03-09 12:02:00 -0500 |
commit | 3f1ca4da2a0e29850eadec7a8d69444081da099c (patch) | |
tree | 299cdc105628d31b3c1618523cfc43fcc393b562 | |
parent | 268317dd331bcdbe1c2828583034c0274a19eea3 (diff) |
Simplify filter reload code
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | sitestatic/archweb.js | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sitestatic/archweb.js b/sitestatic/archweb.js index 0a979494..0c4059a9 100644 --- a/sitestatic/archweb.js +++ b/sitestatic/archweb.js @@ -376,10 +376,7 @@ function filter_todolist_load(list_id) { if (!state) return; state = JSON.parse(state); - $('#todolist_filter .arch_filter').removeAttr('checked'); - $('#todolist_filter .repo_filter').removeAttr('checked'); - $('#id_incomplete').removeAttr('checked'); - $('#id_mine_only').removeAttr('checked'); + $('#todolist_filter input[type="checkbox"]').removeAttr('checked'); $.each(state, function (i, v) { // this assumes our only filters are checkboxes $('#todolist_filter input[name="' + v['name'] + '"]').attr('checked', 'checked'); @@ -395,7 +392,7 @@ function filter_report_load(report_id) { if (!state) return; state = JSON.parse(state); - $('#report_filter input[type="checkbox"]').removeAttr('checked') + $('#report_filter input[type="checkbox"]').removeAttr('checked'); $.each(state, function (i, v) { // this assumes our only filters are checkboxes $('#report_filter input[name="' + v['name'] + '"]').attr('checked', 'checked'); @@ -496,9 +493,7 @@ function filter_signoffs_load() { if (!state) return; state = JSON.parse(state); - $('#signoffs_filter .arch_filter').removeAttr('checked'); - $('#signoffs_filter .repo_filter').removeAttr('checked'); - $('#id_pending').removeAttr('checked'); + $('#signoffs_filter input[type="checkbox"]').removeAttr('checked'); $.each(state, function (i, v) { // this assumes our only filters are checkboxes $('#signoffs_filter input[name="' + v['name'] + '"]').attr('checked', 'checked'); |