]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/directions.js
Merge remote-tracking branch 'upstream/pull/5083'
[rails.git] / app / assets / javascripts / index / directions.js
index 0f3c410f7320a09a6ca79b61762112fe085a13cb..3f78c708945147f08df780715d320c66a56a8625 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) {