diff options
author | Dave Arter <davea@mysociety.org> | 2018-10-23 17:25:39 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2018-11-22 13:55:42 +0000 |
commit | 755910d87c36c1ec4e6b8216cf50954fbd93b783 (patch) | |
tree | 47b4f7c28cc4a32f8042082fccf6f6ac168ff301 /web/js/map-OpenLayers.js | |
parent | fcb4fa41923ae77c064cff52e14a3a37d545879b (diff) |
Disable two-tap marker highlighting on touchscreens
Fixes #2294
Diffstat (limited to 'web/js/map-OpenLayers.js')
-rw-r--r-- | web/js/map-OpenLayers.js | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index eff52932f..66168925a 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -839,17 +839,20 @@ $.extend(fixmystreet.utils, { $(fixmystreet).trigger('maps:update_view'); }); - (function() { - var timeout; - $('#js-reports-list').on('mouseenter', '.item-list--reports__item', function(){ - var href = $('a', this).attr('href'); - var id = parseInt(href.replace(/^.*[\/]([0-9]+)$/, '$1'),10); - clearTimeout(timeout); - fixmystreet.maps.markers_highlight(id); - }).on('mouseleave', '.item-list--reports__item', function(){ - timeout = setTimeout(fixmystreet.maps.markers_highlight, 50); - }); - })(); + if (!fixmystreet.map.events.extensions.buttonclick.isDeviceTouchCapable) { + // On touchscreens go straight to the report (see #2294). + (function() { + var timeout; + $('#js-reports-list').on('mouseenter', '.item-list--reports__item', function(){ + var href = $('a', this).attr('href'); + var id = parseInt(href.replace(/^.*[\/]([0-9]+)$/, '$1'),10); + clearTimeout(timeout); + fixmystreet.maps.markers_highlight(id); + }).on('mouseleave', '.item-list--reports__item', function(){ + timeout = setTimeout(fixmystreet.maps.markers_highlight, 50); + }); + })(); + } }); // End maps closure |