]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/5088'
authorTom Hughes <tom@compton.nu>
Fri, 16 Aug 2024 16:24:50 +0000 (17:24 +0100)
committerTom Hughes <tom@compton.nu>
Fri, 16 Aug 2024 16:24:50 +0000 (17:24 +0100)
app/assets/javascripts/index/directions.js

index b34f18ed1e52fd24b3f89c6de75957adb7745991..e2cdd3a548b80e52f33048b6ed3979ea9ce8493a 100644 (file)
@@ -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) {