aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-06-07 14:26:06 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-06-07 14:30:32 +0100
commiteb56ef56d25b6b2a6834214dd7e64d588e57afbb (patch)
tree20d3725c9b23dfd89a25b1d371afdf79262e5e19
parent80cf37ef3f52d5b466c13c7bddfddd62f6d4f8fc (diff)
[Buckinghamshire] Enable non-road asset selection.
-rw-r--r--web/cobrands/buckinghamshire/js.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/web/cobrands/buckinghamshire/js.js b/web/cobrands/buckinghamshire/js.js
index af9059208..a4cf46141 100644
--- a/web/cobrands/buckinghamshire/js.js
+++ b/web/cobrands/buckinghamshire/js.js
@@ -164,7 +164,10 @@ fixmystreet.assets.add($.extend(true, {}, defaults, {
all_categories: true,
actions: {
found: function(layer, feature) {
- if (bucks_types.indexOf(feature.attributes.feature_ty) != -1) {
+ if (fixmystreet.assets.selectedFeature()) {
+ hide_responsibility_errors();
+ enable_report_form();
+ } else if (bucks_types.indexOf(feature.attributes.feature_ty) != -1) {
hide_responsibility_errors();
enable_report_form();
} else {
@@ -176,9 +179,15 @@ fixmystreet.assets.add($.extend(true, {}, defaults, {
not_found: function(layer) {
// If a feature wasn't found at the location they've clicked, it's
- // probably a field or something. Show an error to that effect.
- show_responsibility_error("#js-not-a-road");
- disable_report_form();
+ // probably a field or something. Show an error to that effect,
+ // unless an asset is selected.
+ if (fixmystreet.assets.selectedFeature()) {
+ hide_responsibility_errors();
+ enable_report_form();
+ } else {
+ show_responsibility_error("#js-not-a-road");
+ disable_report_form();
+ }
}
},
usrn: {