From: Tom Hughes Date: Tue, 3 Dec 2013 00:23:16 +0000 (+0000) Subject: Merge remote-tracking branch 'jfirebaugh/562' X-Git-Tag: live~4688 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/691352136ab17e4a84394a5b80e758c8a1ce92a0?hp=528d4a040e593f6ce2171167c436dbdf27511711 Merge remote-tracking branch 'jfirebaugh/562' --- 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()}); diff --git a/app/assets/stylesheets/browse.css.scss b/app/assets/stylesheets/browse.css.scss index ff9dad9b4..0aa762a12 100644 --- a/app/assets/stylesheets/browse.css.scss +++ b/app/assets/stylesheets/browse.css.scss @@ -5,6 +5,11 @@ .relation::before { display: inline-block; width: 25px; + margin-left: -25px; +} + +.node, .way, .relation { + margin-left: 25px; } /* Deleted objects */ diff --git a/app/assets/stylesheets/common.css.scss b/app/assets/stylesheets/common.css.scss index d16cf12d4..320413f78 100644 --- a/app/assets/stylesheets/common.css.scss +++ b/app/assets/stylesheets/common.css.scss @@ -1084,6 +1084,7 @@ header .search_form { width: 50%; float: left; padding: 6px 10px; + word-wrap: break-word; } .browse-tag-k { diff --git a/app/helpers/geocoder_helper.rb b/app/helpers/geocoder_helper.rb index ce6c7eafa..04f437a7c 100644 --- a/app/helpers/geocoder_helper.rb +++ b/app/helpers/geocoder_helper.rb @@ -5,9 +5,9 @@ module GeocoderHelper if result[:type] and result[:id] url = url_for(:controller => :browse, :action => result[:type], :id => result[:id]) elsif result[:min_lon] and result[:min_lat] and result[:max_lon] and result[:max_lat] - url = "?minlon=#{result[:min_lon]}&minlat=#{result[:min_lat]}&maxlon=#{result[:max_lon]}&maxlat=#{result[:max_lat]}" + url = "/?bbox=#{result[:min_lon]},#{result[:min_lat]},#{result[:max_lon]},#{result[:max_lat]}" else - url = "?mlat=#{result[:lat]}&mlon=#{result[:lon]}&zoom=#{result[:zoom]}" + url = "/#map=#{result[:zoom]}/#{result[:lat]}/#{result[:lon]}" end result.each do |key,value|