aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2016-11-22 13:04:25 +0000
committerDave Arter <davea@mysociety.org>2016-12-13 16:31:10 +0000
commitec6389940afce877a0bc7771d11a27ee7183f96a (patch)
treefaac683c3d9a5ec56b9e54d8913742f1169f0f5e /web
parent05ba5147de9dc7b68f3c9048771fcabf80f20eca (diff)
Make it clearer that report is closed when marked as duplicate
- Record state change when leaving update and marking as duplicate - Change save button wording to match problem state when inspecting - Make it clearer that updates marking a report as duplicate actually close the report
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index 2a5c85872..cd3b127d6 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -390,7 +390,6 @@ $.extend(fixmystreet.set_up, {
});
},
-
manage_duplicates: function() {
// Deal with changes to report state by inspector/other staff, specifically
// displaying nearby reports if it's changed to 'duplicate'.
@@ -657,6 +656,18 @@ $.extend(fixmystreet.set_up, {
$("form#report_inspect_form " + selector).removeClass("hidden");
});
+ // The inspect form submit button can change depending on the selected state
+ $("#report_inspect_form [name=state]").change(function(){
+ var state = $(this).val();
+ var $submit = $("#report_inspect_form input[type=submit]");
+ var value = $submit.attr('data-value-'+state);
+ if (value !== undefined) {
+ $submit.val(value);
+ } else {
+ $submit.val($submit.data('valueOriginal'));
+ }
+ }).change();
+
$('.js-toggle-public-update').each(function() {
var $checkbox = $(this);
var toggle_public_update = function() {