X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/691352136ab17e4a84394a5b80e758c8a1ce92a0..70be43201aeb20d038ed66eefb87251e8efba87a:/app/assets/javascripts/index.js diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index c5532cfc4..0f2971f2c 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -197,14 +197,11 @@ $(document).ready(function () { }); $("a[data-editor=remote]").click(function(e) { - remoteEditHandler(map.getBounds()); - e.preventDefault(); + var params = OSM.mapParams(this.search); + remoteEditHandler(map.getBounds(), params.object); + e.preventDefault(); }); - if (OSM.preferred_editor == "remote" && $('body').hasClass("site-edit")) { - remoteEditHandler(map.getBounds()); - } - if (OSM.params().edit_help) { $('#editanchor') .removeAttr('title') @@ -284,6 +281,11 @@ $(document).ready(function () { "/changeset/:id": OSM.Browse(map, 'changeset') }); + if (OSM.preferred_editor == "remote" && document.location.pathname == "/edit") { + remoteEditHandler(map.getBounds(), params.object); + OSM.router.setCurrentPath("/"); + } + OSM.router.load(); $(document).on("click", "a", function(e) {