Skip to content

Commit

Permalink
Close small mode menu on some interactions
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKhorev committed May 29, 2024
1 parent 6062d49 commit 065fe46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/assets/javascripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
});

Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/index/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
OSM.router.route("/search?whereami=1&query=" + encodeURIComponent(
Expand Down

0 comments on commit 065fe46

Please sign in to comment.