From: Tom Hughes Date: Fri, 16 Aug 2024 16:24:50 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/pull/5088' X-Git-Tag: live~319 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/9b2db63a957a325d16e3989f08c483bd88f1993e?hp=9e807aeca0105497ced7e75bb434a88f41865204 Merge remote-tracking branch 'upstream/pull/5088' --- diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index b34f18ed1..e2cdd3a54 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -75,12 +75,8 @@ OSM.Directions = function (map) { $(".directions_form .btn-close").on("click", function (e) { e.preventDefault(); - var route_from = endpoints[0].value; - if (route_from) { - OSM.router.route("/?query=" + encodeURIComponent(route_from) + OSM.formatHash(map)); - } else { - OSM.router.route("/" + OSM.formatHash(map)); - } + $(".search_form input[name='query']").val(endpoints[0].value); + OSM.router.route("/" + OSM.formatHash(map)); }); function formatDistance(m) {