diff options
author | M Somerville <matthew-github@dracos.co.uk> | 2020-08-13 17:43:38 +0100 |
---|---|---|
committer | M Somerville <matthew-github@dracos.co.uk> | 2020-08-13 19:35:36 +0100 |
commit | a78ffca120498653b52ccbe51703b526d6e7b4ab (patch) | |
tree | 351fc485a4ae338aa137d9487fa0c32b38255ee6 /web | |
parent | 82ad3f1db8debc125e8d54a372b26379a54d63db (diff) |
When inspector changing asset, prevent background map click.
Diffstat (limited to 'web')
-rw-r--r-- | web/js/map-OpenLayers.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index d94d0706f..ada51cbc0 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -1330,8 +1330,13 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { // If we are looking at an individual report, and the report was // ajaxed into the DOM from the all reports page, then clicking // the map background should take us back to the all reports list. - if ($('.js-back-to-report-list').length) { - $('.js-back-to-report-list').trigger('click'); + var asset_button_clicked = $('.btn--change-asset').hasClass('asset-spot'); + if (asset_button_clicked) { + return true; + } + var back_link = $('.js-back-to-report-list'); + if (back_link.length) { + back_link.trigger('click'); return true; } |