From a419f8890a66e584501b831aba9d1fdcbc6894bc Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Thu, 6 Oct 2022 00:42:04 +0300 Subject: [PATCH] Load note from edit link with remote control --- app/assets/javascripts/index.js | 42 ++++++++++++++++++------------- app/assets/javascripts/osm.js.erb | 5 +++- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 5ba36a455..e5590c9f7 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -246,8 +246,8 @@ $(document).ready(function () { }); function remoteEditHandler(bbox, object) { - var loaded = false, - url, + var remoteEditHost = "http://127.0.0.1:8111", + osmHost = location.protocol + "//" + location.host, query = { left: bbox.getWest() - 0.0001, top: bbox.getNorth() + 0.0001, @@ -255,25 +255,31 @@ $(document).ready(function () { bottom: bbox.getSouth() - 0.0001 }; - url = "http://127.0.0.1:8111/load_and_zoom?"; - - if (object) query.select = object.type + object.id; - - var iframe = $("