Skip to content

Commit e6b0e1a

Browse files
committed
Associate search input with route destination instead of departure
1 parent 79f5ccc commit e6b0e1a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/assets/javascripts/index/directions.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ OSM.Directions = function (map) {
7373

7474
$(".directions_form .btn-close").on("click", function (e) {
7575
e.preventDefault();
76-
$(".describe_location").toggle(!endpoints[0].value);
77-
$(".search_form input[name='query']").val(endpoints[0].value);
76+
$(".describe_location").toggle(!endpoints[1].value);
77+
$(".search_form input[name='query']").val(endpoints[1].value);
7878
OSM.router.route("/" + OSM.formatHash(map));
7979
});
8080

app/assets/javascripts/index/search.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ OSM.Search = function (map) {
1111
e.preventDefault();
1212
const query = $(this).closest("form").find("input[name=query]").val();
1313
let search = "";
14-
if (query) search = "?" + new URLSearchParams({ from: query });
14+
if (query) search = "?" + new URLSearchParams({ to: query });
1515
OSM.router.route("/directions" + search + OSM.formatHash(map));
1616
});
1717

0 commit comments

Comments
 (0)