aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2020-04-20 15:35:38 +0100
committerStruan Donald <struan@exo.org.uk>2020-04-29 10:09:29 +0100
commitb03cd41bef71435bb9b4f7ce759366938e08f9d7 (patch)
treebc44a8c3ddbf5b93e884e3efe493cf738be7d1b2
parente41476b0ab7307912f04dd9d876976c63f3076b9 (diff)
[EastSussex] set the group to the optgroup label
Some categories are in multiple groups so pass back the optgroup label so we can assign it to the correct group and category
-rw-r--r--web/cobrands/eastsussex/assets.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/web/cobrands/eastsussex/assets.js b/web/cobrands/eastsussex/assets.js
index a84ad11e9..eed03afbb 100644
--- a/web/cobrands/eastsussex/assets.js
+++ b/web/cobrands/eastsussex/assets.js
@@ -89,9 +89,19 @@ fixmystreet.assets.add(defaults, {
"Filter Drain", "Gully and Catchpit"
]
},
- asset_id_field: 'id',
asset_item: 'drain',
asset_category: ["Blocked Drain", "Broken Drain Cover", "Ditches", "Missing Drain Cover"]
});
+// can have multiple group
+$(function(){
+ $("#problem_form").on("change.category", function() {
+ var group = '';
+ if (OpenLayers.Util.indexOf(fixmystreet.bodies, 'East Sussex County Council') != -1 ) {
+ group = $('#form_category :selected').parent().attr('label');
+ }
+ $('#form_group').val(group);
+ });
+});
+
})();