From: Anton Khorev Date: Fri, 28 Jul 2023 15:24:46 +0000 (+0300) Subject: Hide/show welcome banner with hidden attribute X-Git-Tag: live~1154^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/e6987d7dd3f976e2551fc11dcebd7184b0680a0d Hide/show welcome banner with hidden attribute --- diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 38c498169..783c4da8d 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -192,11 +192,11 @@ $(document).ready(function () { }); if (Cookies.get("_osm_welcome") !== "hide") { - $(".welcome").addClass("visible"); + $(".welcome").removeAttr("hidden"); } $(".welcome .btn-close").on("click", function () { - $(".welcome").removeClass("visible"); + $(".welcome").hide(); Cookies.set("_osm_welcome", "hide", { secure: true, expires: expiry, path: "/", samesite: "lax" }); }); diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 19cc8e5be..2605bdd10 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -317,7 +317,7 @@ body.small-nav { display: inline-block; } - .overlay-sidebar #sidebar .welcome.visible { + .overlay-sidebar #sidebar .welcome { display: none; } @@ -439,11 +439,7 @@ body.small-nav { } .welcome { - display: none; - - &.visible { - display: block; - } + display: block; } #sidebar_content { diff --git a/app/views/layouts/map.html.erb b/app/views/layouts/map.html.erb index b3c85d918..6d983d30e 100644 --- a/app/views/layouts/map.html.erb +++ b/app/views/layouts/map.html.erb @@ -41,7 +41,7 @@ <% unless current_user %> -
+