From f32e02af46170adb01cad57aafd32439158a4b51 Mon Sep 17 00:00:00 2001 From: Michael Reber Date: Fri, 31 Jan 2025 21:34:15 +0100 Subject: [PATCH] fix mobile toggle auto close after click --- pkg/web/handlers.go | 4 ++-- pkg/web/templates/index.html | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/web/handlers.go b/pkg/web/handlers.go index 905c5be..3ee7017 100644 --- a/pkg/web/handlers.go +++ b/pkg/web/handlers.go @@ -230,8 +230,8 @@ func IndexHandler(c *gin.Context) { // GetJailFilterConfigHandler returns the raw filter config for a given jail func GetJailFilterConfigHandler(c *gin.Context) { - fmt.Println("----------------------------") - fmt.Println("GetJailFilterConfigHandler called (handlers.go)") // entry point + config.DebugLog("----------------------------") + config.DebugLog("GetJailFilterConfigHandler called (handlers.go)") // entry point jail := c.Param("jail") cfg, err := fail2ban.GetJailConfig(jail) if err != nil { diff --git a/pkg/web/templates/index.html b/pkg/web/templates/index.html index 8b9db2d..ac51a0f 100644 --- a/pkg/web/templates/index.html +++ b/pkg/web/templates/index.html @@ -350,6 +350,13 @@ function showSection(sectionId) { if (sectionId === 'settingsSection') { loadSettings(); } + + // Close navbar on mobile when clicking a menu item + let navbar = document.getElementById('navbarSupportedContent'); + if (navbar.classList.contains('show')) { + let navbarToggler = document.querySelector('.navbar-toggler'); + navbarToggler.click(); + } } //*******************************************************************