From b9bf7359af5ae992f09ec770681fa7354ccb68eb Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Mon, 14 Oct 2019 14:06:41 +0100 Subject: 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. --- web/js/duplicates.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'web/js/duplicates.js') 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() { -- cgit v1.2.3