diff options
author | Struan Donald <struan@exo.org.uk> | 2018-03-27 17:33:40 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2018-04-03 11:08:21 +0100 |
commit | 3c21d8a9793ee7d80a76df278811627e5af88b8f (patch) | |
tree | b9ecddba18c4ea2f5623032e4de7f8bf72fbf07b | |
parent | a253bba519da66f2b0d3de09de895b5364de277f (diff) |
road asset layers can restrict report body
Allow clicking on a road asset to set the only body to send the report
to.
-rw-r--r-- | web/cobrands/fixmystreet/assets.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/web/cobrands/fixmystreet/assets.js b/web/cobrands/fixmystreet/assets.js index 01c74be56..8df7680e9 100644 --- a/web/cobrands/fixmystreet/assets.js +++ b/web/cobrands/fixmystreet/assets.js @@ -92,7 +92,7 @@ fixmystreet.roads = { selected_road = null; } if (selected_road) { - fixmystreet.roads.found(); + fixmystreet.roads.found(road_layer); } else { fixmystreet.roads.not_found(); } @@ -101,19 +101,21 @@ fixmystreet.roads = { } }, - found: function() { + found: function(layer) { var msg = "This road may not be the responsibility of Bromley Borough Council"; if ( $('#road-warning').length ) { $('#road-warning').text(msg); } else { $('.change_location').after('<div class="box-warning" id="road-warning">' + msg + '</div>'); } + $('#single_body_only').val(layer.fixmystreet.body); }, not_found: function() { if ( $('#road-warning').length ) { $('#road-warning').remove(); } + $('#single_body_only').val(''); }, }; |