From 8fee359c140073d75d7d94f488c7828f49514bc6 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 14 Feb 2025 14:42:31 +0000 Subject: [PATCH] [IoW] Message fixing. Add to asset config: construct_selected_asset_message: fixmystreet.assets.isleofwight.construct_message asset_item_message: 'Please select an item or a road/pavement/path on the map »' --- .../fixmystreet-uk-councils/assets.js | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/web/cobrands/fixmystreet-uk-councils/assets.js b/web/cobrands/fixmystreet-uk-councils/assets.js index 6bab0673dd..df9b702f0e 100644 --- a/web/cobrands/fixmystreet-uk-councils/assets.js +++ b/web/cobrands/fixmystreet-uk-councils/assets.js @@ -814,35 +814,35 @@ fixmystreet.assets.isleofwight.streets_stylemap = new OpenLayers.StyleMap({ }); fixmystreet.assets.isleofwight.not_found_msg_update = function() { - $('.category_meta_message').html('Please select an item or a road/pavement/path on the map »'); - $('.category_meta_message').removeClass('meta-highlight'); $("input[name=asset_details]").val(''); + fixmystreet.assets.named_select_action_not_found.call(this); }; fixmystreet.assets.isleofwight.found_item = function(asset) { - var id = asset.attributes.central_asset_id || ''; - if (id !== '') { - var attrib = asset.attributes; - var asset_name = attrib.feature_type_name + '; ' + attrib.site_name + '; ' + attrib.feature_location; - $('.category_meta_message').html('You have selected ' + asset_name); - $('.category_meta_message').addClass('meta-highlight'); - $("input[name=asset_details]").val(asset_name); - } else { - fixmystreet.assets.isleofwight.not_found_msg_update(); - } + fixmystreet.assets.named_select_action_found.call(this, asset); +}; + +fixmystreet.assets.isleofwight.construct_message = function(asset) { + var id = asset.attributes.central_asset_id || ''; + if (id !== '') { + var attrib = asset.attributes; + var asset_name = attrib.feature_type_name + '; ' + attrib.site_name + '; ' + attrib.feature_location; + $("input[name=asset_details]").val(asset_name); + return 'You have selected ' + asset_name; + } }; fixmystreet.assets.isleofwight.line_found_item = function(layer, feature) { if ( fixmystreet.assets.selectedFeature() ) { return; } - fixmystreet.assets.isleofwight.found_item(feature); + fixmystreet.assets.isleofwight.found_item.call(layer, feature); }; fixmystreet.assets.isleofwight.line_not_found_msg_update = function(layer) { if ( fixmystreet.assets.selectedFeature() ) { return; } - fixmystreet.assets.isleofwight.not_found_msg_update(); + fixmystreet.assets.isleofwight.not_found_msg_update.call(layer); }; /* Lincolnshire */