Fix sidebar collapse functionality for all three layouts
Build And Push Image / docker (push) Successful in 1m56s Details

- Remove manual width control that was conflicting with rail prop
- Use fixed width and rail-width props for proper Vuetify 3 behavior
- Simplify toggleDrawer function to just toggle miniVariant
- Add v-show directive to hide list groups in rail mode
- Applied fixes to admin.vue, member.vue, and board.vue layouts

The sidebar now properly collapses to 56px rail mode showing only icons,
and expands to 280px full width showing complete navigation items.
This commit is contained in:
Matt 2025-08-31 19:36:28 +02:00
parent c99599f7a2
commit 185ac24067
3 changed files with 15 additions and 33 deletions

View File

@ -3,10 +3,11 @@
<v-navigation-drawer <v-navigation-drawer
v-model="drawer" v-model="drawer"
app app
:width="miniVariant ? 56 : 280"
:rail="miniVariant" :rail="miniVariant"
:expand-on-hover="false" :expand-on-hover="false"
permanent permanent
width="280"
rail-width="56"
class="enhanced-glass-drawer" class="enhanced-glass-drawer"
> >
<!-- Enhanced Logo Section --> <!-- Enhanced Logo Section -->
@ -52,7 +53,7 @@
</v-tooltip> </v-tooltip>
<!-- User Management --> <!-- User Management -->
<v-list-group value="users"> <v-list-group value="users" v-show="!miniVariant">
<template v-slot:activator="{ props }"> <template v-slot:activator="{ props }">
<v-list-item <v-list-item
v-bind="props" v-bind="props"
@ -87,7 +88,7 @@
</v-list-group> </v-list-group>
<!-- Member Management --> <!-- Member Management -->
<v-list-group value="members"> <v-list-group value="members" v-show="!miniVariant">
<template v-slot:activator="{ props }"> <template v-slot:activator="{ props }">
<v-list-item <v-list-item
v-bind="props" v-bind="props"
@ -118,7 +119,7 @@
</v-list-group> </v-list-group>
<!-- Financial Management --> <!-- Financial Management -->
<v-list-group value="financial"> <v-list-group value="financial" v-show="!miniVariant">
<template v-slot:activator="{ props }"> <template v-slot:activator="{ props }">
<v-list-item <v-list-item
v-bind="props" v-bind="props"
@ -149,7 +150,7 @@
</v-list-group> </v-list-group>
<!-- System Configuration --> <!-- System Configuration -->
<v-list-group value="system"> <v-list-group value="system" v-show="!miniVariant">
<template v-slot:activator="{ props }"> <template v-slot:activator="{ props }">
<v-list-item <v-list-item
v-bind="props" v-bind="props"
@ -508,14 +509,7 @@ const openKeycloak = () => {
}; };
const toggleDrawer = () => { const toggleDrawer = () => {
if (!drawer.value) { miniVariant.value = !miniVariant.value;
drawer.value = true;
miniVariant.value = false;
} else if (miniVariant.value) {
miniVariant.value = false;
} else {
miniVariant.value = true;
}
}; };
const toggleCommandPalette = () => { const toggleCommandPalette = () => {

View File

@ -3,10 +3,11 @@
<v-navigation-drawer <v-navigation-drawer
v-model="drawer" v-model="drawer"
app app
:width="miniVariant ? 56 : 280"
:rail="miniVariant" :rail="miniVariant"
:expand-on-hover="false" :expand-on-hover="false"
permanent permanent
width="280"
rail-width="56"
class="enhanced-glass-drawer" class="enhanced-glass-drawer"
> >
<!-- Enhanced Logo Section --> <!-- Enhanced Logo Section -->
@ -52,7 +53,7 @@
</v-tooltip> </v-tooltip>
<!-- Member Management --> <!-- Member Management -->
<v-list-group value="members"> <v-list-group value="members" v-show="!miniVariant">
<template v-slot:activator="{ props }"> <template v-slot:activator="{ props }">
<v-list-item <v-list-item
v-bind="props" v-bind="props"
@ -92,7 +93,7 @@
</v-list-group> </v-list-group>
<!-- Events & Meetings --> <!-- Events & Meetings -->
<v-list-group value="events"> <v-list-group value="events" v-show="!miniVariant">
<template v-slot:activator="{ props }"> <template v-slot:activator="{ props }">
<v-list-item <v-list-item
v-bind="props" v-bind="props"
@ -389,14 +390,7 @@ onMounted(async () => {
}); });
const toggleDrawer = () => { const toggleDrawer = () => {
if (!drawer.value) { miniVariant.value = !miniVariant.value;
drawer.value = true;
miniVariant.value = false;
} else if (miniVariant.value) {
miniVariant.value = false;
} else {
miniVariant.value = true;
}
}; };
const toggleSearch = () => { const toggleSearch = () => {

View File

@ -3,10 +3,11 @@
<v-navigation-drawer <v-navigation-drawer
v-model="drawer" v-model="drawer"
app app
:width="miniVariant ? 56 : 280"
:rail="miniVariant" :rail="miniVariant"
:expand-on-hover="false" :expand-on-hover="false"
permanent permanent
width="280"
rail-width="56"
class="enhanced-glass-drawer" class="enhanced-glass-drawer"
> >
<!-- Logo Section with Enhanced Glass Effect --> <!-- Logo Section with Enhanced Glass Effect -->
@ -285,14 +286,7 @@ onMounted(async () => {
}); });
const toggleDrawer = () => { const toggleDrawer = () => {
if (!drawer.value) { miniVariant.value = !miniVariant.value;
drawer.value = true;
miniVariant.value = false;
} else if (miniVariant.value) {
miniVariant.value = false;
} else {
miniVariant.value = true;
}
}; };
const handleLogout = async () => { const handleLogout = async () => {