diff options
Diffstat (limited to 'web/js/duplicates.js')
-rw-r--r-- | web/js/duplicates.js | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/web/js/duplicates.js b/web/js/duplicates.js index ede22dc18..4f1574c0f 100644 --- a/web/js/duplicates.js +++ b/web/js/duplicates.js @@ -42,6 +42,10 @@ url_params.pin_size = 'normal'; } + if ($('html').hasClass('mobile')) { + url_params.inline_maps = 1; + } + if (category && params && params.check_duplicates_dismissal ) { dismissed = category === dismissed_category; dismissed_category = category; @@ -89,15 +93,21 @@ $('.js-hide-if-invalid-category_extras').slideUp(); } - // Highlight map pin when hovering associated list item. - var timeout; - $reports.on('mouseenter', function(){ - var id = parseInt( $(this).data('reportId'), 10 ); - clearTimeout( timeout ); - fixmystreet.maps.markers_highlight( id ); - }).on('mouseleave', function(){ - timeout = setTimeout( fixmystreet.maps.markers_highlight, 50 ); - }); + if (!fixmystreet.map.events.extensions.buttonclick.isDeviceTouchCapable) { + // Highlight map pin when hovering associated list item. + // (not on touchscreens though because a) the 'mouseenter' handler means + // two taps are required on the 'read more' button - one to highlight + // the list item and another to activate the button- and b) the pins + // might be scrolled off the top of the screen anyway e.g. on phones) + var timeout; + $reports.on('mouseenter', function(){ + var id = parseInt( $(this).data('reportId'), 10 ); + clearTimeout( timeout ); + fixmystreet.maps.markers_highlight( id ); + }).on('mouseleave', function(){ + timeout = setTimeout( fixmystreet.maps.markers_highlight, 50 ); + }); + } // Add a "select this report" button, when on the report inspect form. if ( $('#report_inspect_form').length ) { |