aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--web/cobrands/bexley/js.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/web/cobrands/bexley/js.js b/web/cobrands/bexley/js.js
index 70c8ae255..580320325 100644
--- a/web/cobrands/bexley/js.js
+++ b/web/cobrands/bexley/js.js
@@ -130,5 +130,28 @@ fixmystreet.assets.add(labeled_defaults, {
asset_item: 'street light'
});
+// We need to trigger the below function on subcategory change also
+$(function(){
+ $("#problem_form").on("change.category", "#form_DALocation", function() {
+ $(fixmystreet).trigger('report_new:category_change', [ $('#form_category') ]);
+ });
+});
+
+fixmystreet.message_controller.register_category({
+ body: defaults.body,
+ category: function() {
+ var cat = $('#form_category').val();
+ if (cat === 'Dead animal') {
+ var where = $('#form_DALocation').val();
+ if (where === 'Garden' || where === 'Other private property') {
+ return true;
+ }
+ }
+ return false;
+ },
+ keep_category_extras: true,
+ message: 'Please follow the link below to pay to remove a dead animal from a private property.'
+});
+
})();