From 6a975f1627d259723f868691cca27e539a5166f9 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Thu, 7 Jun 2018 11:28:50 +0100 Subject: Fix pin clicking on non-/around pages. The fix in de36c49d1 broke pin clicking on other map list pages, such as /my and /reports. --- web/cobrands/fixmystreet/fixmystreet.js | 4 +++- web/js/map-OpenLayers.js | 4 +++- 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; -- cgit v1.2.3