aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2019-03-05 11:22:13 +0000
committerStruan Donald <struan@exo.org.uk>2019-03-25 14:41:12 +0000
commitc63a859da224536ec9c114fcdb741e4e782efd25 (patch)
tree4e0a4e20d254894ea847fb27610278b9d5a28074 /web
parentf735e31c3830a2242775482f4fe3553fd22cc25b (diff)
make sure found and not_found actions exists before calling
just because fixmystreet.actions exists on a layer it does not mean the found or not_found methods are there so check for them too. Otherwise we don't fall back to the default actions as the JS errors.
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmystreet/assets.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/web/cobrands/fixmystreet/assets.js b/web/cobrands/fixmystreet/assets.js
index bb0a1e9ad..53eb616a0 100644
--- a/web/cobrands/fixmystreet/assets.js
+++ b/web/cobrands/fixmystreet/assets.js
@@ -222,7 +222,7 @@ OpenLayers.Layer.VectorNearest = OpenLayers.Class(OpenLayers.Layer.VectorAsset,
},
road_found: function() {
- if (this.fixmystreet.actions) {
+ if (this.fixmystreet.actions && this.fixmystreet.actions.found) {
this.fixmystreet.actions.found(this, this.selected_feature);
} else if (!fixmystreet.assets.selectedFeature()) {
fixmystreet.body_overrides.only_send(this.fixmystreet.body);
@@ -230,7 +230,7 @@ OpenLayers.Layer.VectorNearest = OpenLayers.Class(OpenLayers.Layer.VectorAsset,
},
road_not_found: function() {
- if (this.fixmystreet.actions) {
+ if (this.fixmystreet.actions && this.fixmystreet.actions.not_found) {
this.fixmystreet.actions.not_found(this);
} else {
fixmystreet.body_overrides.remove_only_send();