From: Anton Khorev Date: Wed, 29 May 2024 04:14:44 +0000 (+0300) Subject: Close small mode menu on some interactions X-Git-Tag: live~17^2~3 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/7fb432dc32d926f063d31e727e9d0cf88bca4f02?ds=sidebyside;hp=e717c375bcb7a6fe5a10b35f28e6a16456ddd393 Close small mode menu on some interactions --- diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 4f3c414f5..820c268b6 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -412,6 +412,9 @@ $(document).ready(function () { if (OSM.router.route(this.pathname + this.search + this.hash)) { e.preventDefault(); + if (this.pathname !== "/directions") { + $("header").addClass("closed"); + } } }); diff --git a/app/assets/javascripts/index/search.js b/app/assets/javascripts/index/search.js index 476ad30a1..2bfbb2e1c 100644 --- a/app/assets/javascripts/index/search.js +++ b/app/assets/javascripts/index/search.js @@ -32,6 +32,7 @@ OSM.Search = function (map) { $(".describe_location").on("click", function (e) { e.preventDefault(); + $("header").addClass("closed"); var center = map.getCenter().wrap(), precision = OSM.zoomPrecision(map.getZoom()), lat = center.lat.toFixed(precision),