diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-10-14 14:06:41 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-10-15 09:55:29 +0100 |
commit | b9bf7359af5ae992f09ec770681fa7354ccb68eb (patch) | |
tree | 39d62b9d60a4b7abb09d77801cfd6cbe1ddd61ac /web/js/duplicates.js | |
parent | 6a55d13ba170a49bff5cde04d800ded9c68c74a3 (diff) |
Fix issue loading inspector duplicates on /around.
As there are two category drop-downs in this situation (one in the
hidden reporting form, one in the inspect form), the correct entry
needs to be specified.
Diffstat (limited to 'web/js/duplicates.js')
-rw-r--r-- | web/js/duplicates.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/web/js/duplicates.js b/web/js/duplicates.js index a8aceb9e3..ede22dc18 100644 --- a/web/js/duplicates.js +++ b/web/js/duplicates.js @@ -13,12 +13,14 @@ // but undefined on new report page. var report_id = $("#report_inspect_form .js-report-id").text() || undefined; - function refresh_duplicate_list(evt, params) { + function refresh_duplicate_list(evt, params, category) { if (params && params.skip_duplicates) { return; } - var category = $('select[name="category"]').val(); + if (!category) { + category = $('select[name="category"]').val(); + } if (category === '-- Pick a category --') { return; } @@ -195,7 +197,8 @@ if (!!duplicate_of) { return; } - refresh_duplicate_list(); + var category = $("#report_inspect_form [name=category]").val(); + refresh_duplicate_list(undefined, {}, category); } function take_effect() { |