Revert 39468944 and fix osmlab#91 without loosing the editor choice
authorTom Hughes <tom@compton.nu>
Fri, 29 Nov 2013 15:33:09 +0000 (15:33 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 29 Nov 2013 15:33:09 +0000 (15:33 +0000)
app/assets/javascripts/application.js

index 25d68d0ea05d0bf608bdc05dc3b1fb1e99fc49a6..bc8719700aa217b53aff1bd8676db0fcc44f9e2d 100644 (file)
@@ -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