Merge remote-tracking branch 'upstream/pull/5710'

This commit is contained in:
Tom Hughes 2025-02-19 18:01:52 +00:00
commit 1f8a86f7bc
2 changed files with 3 additions and 3 deletions

View file

@ -73,8 +73,8 @@ OSM.Directions = function (map) {
$(".directions_form .btn-close").on("click", function (e) {
e.preventDefault();
$(".describe_location").toggle(!endpoints[0].value);
$(".search_form input[name='query']").val(endpoints[0].value);
$(".describe_location").toggle(!endpoints[1].value);
$(".search_form input[name='query']").val(endpoints[1].value);
OSM.router.route("/" + OSM.formatHash(map));
});

View file

@ -11,7 +11,7 @@ OSM.Search = function (map) {
e.preventDefault();
const query = $(this).closest("form").find("input[name=query]").val();
let search = "";
if (query) search = "?" + new URLSearchParams({ from: query });
if (query) search = "?" + new URLSearchParams({ to: query });
OSM.router.route("/directions" + search + OSM.formatHash(map));
});