diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index 5f1bb5f..eebed54 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -2,7 +2,7 @@ - + @@ -56,32 +56,44 @@ side="left" bordered :mini="leftDrawerMini" - @click.capture="openMenu" + @click.capture="openMenuMini" > - - - -
+ + - - - - + +
+ + + + + - - Logout - - + + Logout + + +
+
+
+
@@ -125,7 +137,7 @@ export default defineComponent({ const mainStore = useMainStore(); const flaschengeist = inject('flaschengeist'); const leftDrawer = ref(!Platform.is.mobile); - const leftDrawerMini = ref(false); + const leftDrawerMini = ref(true); const mainLinks = flaschengeist?.menuLinks || []; const notifications = computed(() => mainStore.notifications.slice().reverse()); const polling = ref(NaN); @@ -138,9 +150,11 @@ export default defineComponent({ void mainStore.getShortcuts(); }); onBeforeUnmount(() => window.clearInterval(polling.value)); - + /* function openMenu(event: { target: HTMLInputElement }) { - if (event.target.nodeName === 'DIV') leftDrawerMini.value = false; + console.log(event.target.nodeName); + if (event.target.nodeName === 'DIV' || event.target.nodeName === 'I') + leftDrawerMini.value = false; else { if (!leftDrawer.value || leftDrawerMini.value) { leftDrawer.value = true; @@ -151,7 +165,13 @@ export default defineComponent({ } } } - +*/ + function openMenu(value = !leftDrawer.value) { + leftDrawer.value = value; + } + function openMenuMini(value = !leftDrawerMini.value) { + leftDrawerMini.value = value; + } function logout() { void router.push({ name: 'login', params: { logout: 'logout' } }); void mainStore.logout(); @@ -214,6 +234,7 @@ export default defineComponent({ notifications, noPermission, openMenu, + openMenuMini, remove, requestPermission, useNative,