X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/b625eefdeb55822c7d4a4dafa6473c8ac537ef48..7f3cb3c6246e6e271761e714cceb081e85a4d245:/app/assets/javascripts/index/search.js diff --git a/app/assets/javascripts/index/search.js b/app/assets/javascripts/index/search.js index d41fc7d53..94bb52a1b 100644 --- a/app/assets/javascripts/index/search.js +++ b/app/assets/javascripts/index/search.js @@ -9,9 +9,9 @@ OSM.Search = function (map) { } }); - $(".search_form a.button.switch_link").on("click", function (e) { + $(".search_form a.btn.switch_link").on("click", function (e) { e.preventDefault(); - var query = $(e.target).parent().parent().find("input[name=query]").val(); + var query = $(this).closest("form").find("input[name=query]").val(); if (query) { OSM.router.route("/directions?from=" + encodeURIComponent(query) + OSM.formatHash(map)); } else {