From 95f1069552e9581152ad1a4ca772d36357e4006c Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Mon, 2 Dec 2013 14:08:56 -0800 Subject: [PATCH] Fix application error on non-feature search results Fixes #560 --- app/assets/javascripts/index/search.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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()}); -- 2.39.5