X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/a5b784bdf7e093c76d0c09c56ae274c93c4cb956..59f1a6d49644143bfe643e0cabaaea72792fa5db:/app/assets/javascripts/index.js diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 5e96c3517..7d2e954ad 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -297,12 +297,13 @@ $(document).ready(function () { if (this.host === window.location.host && OSM.route(this.pathname + this.search + this.hash)) e.preventDefault(); }); - $("#search_form").on("submit", function(e) { + $(".search_form").on("submit", function(e) { e.preventDefault(); - OSM.route("/search?query=" + encodeURIComponent($("#query").val()) + OSM.formatHash(map)); + $("header").addClass("closed"); + OSM.route("/search?query=" + encodeURIComponent($(this).find("input[name=query]").val()) + OSM.formatHash(map)); }); - $("#describe_location").on("click", function(e) { + $(".describe_location").on("click", function(e) { e.preventDefault(); var precision = zoomPrecision(map.getZoom()); OSM.route("/search?query=" + encodeURIComponent(