From: Tom Hughes Date: Fri, 29 Nov 2013 15:33:09 +0000 (+0000) Subject: Revert 39468944 and fix osmlab#91 without loosing the editor choice X-Git-Tag: live~5167 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/be088602fbd0bfe01f982ea40d9dd34b00afb547 Revert 39468944 and fix osmlab#91 without loosing the editor choice --- diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 25d68d0ea..bc8719700 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -61,13 +61,22 @@ function remoteEditHandler(bbox, select) { function updatelinks(loc, zoom, layers, object) { $(".geolink").each(function(index, link) { var href = link.href.split(/[?#]/)[0], + args = querystring.parse(link.search.substring(1)), editlink = $(link).hasClass("editlink"); if (object && editlink) { - href += '?' + object.type + '=' + object.id; + delete args['node']; + delete args['way']; + delete args['relation']; + delete args['changeset']; + + args[object.type] = object.id; } - var args = { + var query = querystring.stringify(args); + if (query) href += '?' + query; + + args = { lat: loc.lat, lon: loc.lon || loc.lng, zoom: zoom