X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/68a3df4d53c84508bf443058040379c3a18eb1a7..6053ed41242448b286cae2b14126add52ea07fb5:/app/assets/javascripts/index/search.js?ds=inline diff --git a/app/assets/javascripts/index/search.js b/app/assets/javascripts/index/search.js index c1c95a3e4..6b6f3231f 100644 --- a/app/assets/javascripts/index/search.js +++ b/app/assets/javascripts/index/search.js @@ -30,11 +30,16 @@ OSM.Search = function(map) { center = L.latLng(data.lat, data.lon); if (data.minLon && data.minLat && data.maxLon && data.maxLat) { - map.fitBounds([[data.minLat, data.minLon], - [data.maxLat, data.maxLon]]); + map.fitBounds([[data.minLat, data.minLon], [data.maxLat, data.maxLon]]); } else { map.setView(center, data.zoom); } + + // Let clicks to object browser links propagate. + if (data.type && data.id) return; + + e.preventDefault(); + e.stopPropagation(); } var marker = L.marker([0, 0], {icon: getUserIcon()});