From 7fb432dc32d926f063d31e727e9d0cf88bca4f02 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Wed, 29 May 2024 07:14:44 +0300 Subject: [PATCH 1/1] Close small mode menu on some interactions --- app/assets/javascripts/index.js | 3 +++ app/assets/javascripts/index/search.js | 1 + 2 files changed, 4 insertions(+) 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), -- 2.39.5