]> git.openstreetmap.org Git - rails.git/commitdiff
Close small mode menu on some interactions
authorAnton Khorev <tony29@yandex.ru>
Wed, 29 May 2024 04:14:44 +0000 (07:14 +0300)
committerAnton Khorev <tony29@yandex.ru>
Mon, 2 Sep 2024 23:59:18 +0000 (02:59 +0300)
app/assets/javascripts/index.js
app/assets/javascripts/index/search.js

index 4f3c414f5b85b207b399f4ed874bee7649e1ea92..820c268b6aab7219e10a042024c053c943d60676 100644 (file)
@@ -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");
+      }
     }
   });
 
index 476ad30a1ac11de80ad555ecf430ca6ef61923b1..2bfbb2e1c6d4fa9bc18c7264cdbb65651785899a 100644 (file)
@@ -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),