From d42324565b4f64ed76b94f18c88a401a6e41f906 Mon Sep 17 00:00:00 2001 From: Behrokh Satarnejad Date: Mon, 21 Oct 2024 12:41:05 +0200 Subject: [PATCH] on resizing the window hide the menu if the new window size is small --- app/views/layouts/base.html.erb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index b30d04035b06..98343a837c4b 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -180,6 +180,12 @@ See COPYRIGHT and LICENSE files for more details. $('.can-hide-navigation').addClass('hidden-navigation'); } + window.addEventListener('resize', function() { + if (window.innerWidth < 1012) { + $('.can-hide-navigation').addClass('hidden-navigation'); + } + }); + if (mainMenuCollapsed === 'true') { savedMainMenuWidth = 0; }