X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/b8d83738158e3efc0792ef2c66bb41e846ed28ec..33a2ccf560dbb4054d260a7ba9b4a572d4668ae9:/app/assets/javascripts/edit/id.js.erb diff --git a/app/assets/javascripts/edit/id.js.erb b/app/assets/javascripts/edit/id.js.erb index 02299d215..90318788c 100644 --- a/app/assets/javascripts/edit/id.js.erb +++ b/app/assets/javascripts/edit/id.js.erb @@ -4,12 +4,13 @@ $(document).ready(function () { var id = $("#id-embed"); if (id.data("configured") === true) { - var hashParams = OSM.params(location.hash.substring(1)); + var hash = location.hash.substring(1); + var hashParams = hash ? OSM.params(hash) : {}; var mapParams = OSM.mapParams(); var params = {}; if (mapParams.object) { - params.id = mapParams.object.type[0] + mapParams.object.id; + params.id = mapParams.object.type + '/' + mapParams.object.id; mapParams = OSM.parseHash(location.hash); if (mapParams.center) { params.map = mapParams.zoom + '/' + mapParams.center.lat + '/' + mapParams.center.lng;