aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-06-07 11:28:50 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-06-07 11:28:50 +0100
commit6a975f1627d259723f868691cca27e539a5166f9 (patch)
treea72f44d41bc22e4c1e82599adf4bfb0249b78515
parente2359285ce7fb149b5195fe9104513776d806c49 (diff)
Fix pin clicking on non-/around pages.
The fix in de36c49d1 broke pin clicking on other map list pages, such as /my and /reports.
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js4
-rw-r--r--web/js/map-OpenLayers.js4
2 files changed, 6 insertions, 2 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index bf920c5b8..a849447ca 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -1151,7 +1151,9 @@ fixmystreet.display = {
}
// We disabled this upon first touch to prevent it taking effect, re-enable now
- fixmystreet.maps.click_control.activate();
+ if (fixmystreet.maps.click_control) {
+ fixmystreet.maps.click_control.activate();
+ }
if (typeof callback === 'function') {
callback();
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index 868e2333e..8f84e5c94 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -312,7 +312,9 @@ $.extend(fixmystreet.utils, {
}
// clickFeature operates on touchstart, we do not want the map click taking place on touchend!
- fixmystreet.maps.click_control.deactivate();
+ if (fixmystreet.maps.click_control) {
+ fixmystreet.maps.click_control.deactivate();
+ }
// All of this, just so that ctrl/cmd-click on a pin works?!
var event;