AppSidebar works now

This commit is contained in:
2025-02-01 23:17:55 +01:00
parent 28ae19aa72
commit db8f3657d0

View File

@@ -1,14 +1,16 @@
<script lang="ts"> <script lang="ts">
export default { export default {
components: { components: {
} },
} mounted() {
//Pages
document.getElementById('pages-dropdown-button')?.addEventListener('click', () => { document.getElementById('dropdown-pages-button')?.addEventListener('click', () => {
const dropdown = document.getElementById('dropdown-pages'); const button = document.getElementById('dropdown-pages-button');
const button = document.getElementById('pages-dropdown-button'); const dropdown = document.getElementById("dropdown-pages");
if (dropdown?.classList.contains('hidden')) { if (dropdown?.classList.contains('hidden')) {
dropdown?.classList.remove('hidden'); dropdown?.classList.remove('hidden');
@@ -19,6 +21,36 @@ document.getElementById('pages-dropdown-button')?.addEventListener('click', () =
} }
}); });
//Sales
document.getElementById('dropdown-sales-button')?.addEventListener('click', () => {
const button = document.getElementById('dropdown-sales-button');
const dropdown = document.getElementById("dropdown-sales");
if (dropdown?.classList.contains('hidden')) {
dropdown?.classList.remove('hidden');
button?.setAttribute('aria-expanded', 'true');
} else {
dropdown?.classList.add('hidden');
button?.setAttribute('aria-expanded', 'false');
}
});
//Authentication
document.getElementById('dropdown-authentication-button')?.addEventListener('click', () => {
const button = document.getElementById('dropdown-authentication-button');
const dropdown = document.getElementById("dropdown-authentication");
if (dropdown?.classList.contains('hidden')) {
dropdown?.classList.remove('hidden');
button?.setAttribute('aria-expanded', 'true');
} else {
dropdown?.classList.add('hidden');
button?.setAttribute('aria-expanded', 'false');
}
});
}
}
</script> </script>
<template> <template>
@@ -146,6 +178,7 @@ document.getElementById('pages-dropdown-button')?.addEventListener('click', () =
class="flex items-center p-2 w-full text-base font-medium text-gray-900 rounded-lg transition duration-75 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700" class="flex items-center p-2 w-full text-base font-medium text-gray-900 rounded-lg transition duration-75 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700"
aria-controls="dropdown-sales" aria-controls="dropdown-sales"
data-collapse-toggle="dropdown-sales" data-collapse-toggle="dropdown-sales"
id="dropdown-sales-button"
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
@@ -234,6 +267,7 @@ document.getElementById('pages-dropdown-button')?.addEventListener('click', () =
class="flex items-center p-2 w-full text-base font-medium text-gray-900 rounded-lg transition duration-75 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700" class="flex items-center p-2 w-full text-base font-medium text-gray-900 rounded-lg transition duration-75 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700"
aria-controls="dropdown-authentication" aria-controls="dropdown-authentication"
data-collapse-toggle="dropdown-authentication" data-collapse-toggle="dropdown-authentication"
id="dropdown-authentication-button"
> >
<svg <svg
aria-hidden="true" aria-hidden="true"