diff options
author | Dave Arter <davea@mysociety.org> | 2019-03-04 16:23:04 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2019-03-25 14:41:12 +0000 |
commit | c031fc02119b5d1fe9bebe78bcadfdf6ff5270d5 (patch) | |
tree | 5dee08e12fc8a00844c1211c53d923cc79867874 /web | |
parent | 6435b5cc21de8297b7d2223098fafc449d1aefa7 (diff) |
Set this to the current Layer in asset_found/asset_not_found calls
Diffstat (limited to 'web')
-rw-r--r-- | web/cobrands/buckinghamshire/assets.js | 12 | ||||
-rw-r--r-- | web/cobrands/fixmystreet/assets.js | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/web/cobrands/buckinghamshire/assets.js b/web/cobrands/buckinghamshire/assets.js index e0b6f729b..7fb0f8833 100644 --- a/web/cobrands/buckinghamshire/assets.js +++ b/web/cobrands/buckinghamshire/assets.js @@ -104,18 +104,18 @@ var labeled_defaults = $.extend(true, {}, defaults, { stylemap: streetlight_stylemap, feature_code: 'feature_id', actions: { - asset_found: function(asset, config) { - var id = asset.attributes[config.feature_code] || ''; + asset_found: function(asset) { + var id = asset.attributes[this.fixmystreet.feature_code] || ''; if (id !== '') { var code = id.replace(/[0-9]/g, ''); - var asset_name = streetlight_code_to_type[code] || config.asset_item; + var asset_name = streetlight_code_to_type[code] || this.fixmystreet.asset_item; $('.category_meta_message').html('You have selected ' + asset_name + ' <b>' + id + '</b>'); } else { - $('.category_meta_message').html('You can pick a <b class="asset-spot">' + config.asset_item + '</b> from the map »'); + $('.category_meta_message').html('You can pick a <b class="asset-spot">' + this.fixmystreet.asset_item + '</b> from the map »'); } }, - asset_not_found: function(config) { - $('.category_meta_message').html('You can pick a <b class="asset-spot">' + config.asset_item + '</b> from the map »'); + asset_not_found: function() { + $('.category_meta_message').html('You can pick a <b class="asset-spot">' + this.fixmystreet.asset_item + '</b> from the map »'); } } }); diff --git a/web/cobrands/fixmystreet/assets.js b/web/cobrands/fixmystreet/assets.js index d22db7bed..732bcb1ef 100644 --- a/web/cobrands/fixmystreet/assets.js +++ b/web/cobrands/fixmystreet/assets.js @@ -112,13 +112,13 @@ OpenLayers.Layer.VectorAsset = OpenLayers.Class(OpenLayers.Layer.Vector, { asset_found: function() { if (this.fixmystreet.actions) { - this.fixmystreet.actions.asset_found(fixmystreet.assets.selectedFeature(), this.fixmystreet); + this.fixmystreet.actions.asset_found.call(this, fixmystreet.assets.selectedFeature()); } }, asset_not_found: function() { if (this.fixmystreet.actions) { - this.fixmystreet.actions.asset_not_found(this.fixmystreet); + this.fixmystreet.actions.asset_not_found.call(this); } }, |