Mac release fix, version 1.0.11, auto-close sidebar

This commit is contained in:
Adam Gaiswinkler
2025-12-10 15:30:46 +01:00
parent 1c835f3f3a
commit c70d38c450
11 changed files with 139 additions and 53 deletions

View File

@ -1,6 +1,8 @@
@namespace SZUAbsolventenverein.Theme.Website
@inherits ThemeBase
@inject NavigationManager NavigationManager
@inject ISettingService SettingService
@implements IDisposable
<main role="main">
<nav class="navbar navbar-dark bg-primary fixed-top app-navbar">
@ -10,7 +12,7 @@
</div>
<!-- Versteckte Checkbox zum Steuern des Menüs (nur HTML, kein Blazor) -->
<input type="checkbox" id="nav-toggle" class="nav-toggle" />
<input type="checkbox" id="nav-toggle" class="nav-toggle" @bind="_navOpen" />
<!-- Burger-Icon, das die Checkbox toggelt -->
<label for="nav-toggle" class="nav-toggle-label">
@ -175,6 +177,12 @@
private bool _showDropdown = false;
private bool _login = true;
private bool _register = true;
private bool _navOpen = false;
protected override void OnInitialized()
{
NavigationManager.LocationChanged += LocationChanged;
}
protected override void OnParametersSet()
{
@ -190,5 +198,14 @@
}
}
private void LocationChanged(object sender, LocationChangedEventArgs args)
{
_navOpen = false;
StateHasChanged();
}
public void Dispose()
{
NavigationManager.LocationChanged -= LocationChanged;
}
}