diff --git a/admin.html b/admin.html
index ab22480..672889f 100644
--- a/admin.html
+++ b/admin.html
@@ -12,7 +12,7 @@
-
+
diff --git a/app.js b/app.js
index 4027a29..4a51565 100644
--- a/app.js
+++ b/app.js
@@ -35,6 +35,8 @@ const logoutButton = document.querySelector('#dashboardLogoutButton');
const favoritesLink = document.querySelector('#favoritesLink');
const adminPanelLink = document.querySelector('#adminPanelLink');
const userBadge = document.querySelector('#dashboardUserBadge');
+const dashboardMenuButton = document.querySelector('#dashboardMenuButton');
+const dashboardMenuPanel = document.querySelector('#dashboardMenuPanel');
function normalize(value) {
return String(value || '').toLowerCase().trim();
@@ -491,6 +493,23 @@ viewOptions.forEach((option) => {
searchInput.addEventListener('input', updateVisibility);
+function closeDashboardMenu() {
+ if (!dashboardMenuButton || !dashboardMenuPanel) return;
+ dashboardMenuButton.setAttribute('aria-expanded', 'false');
+ dashboardMenuButton.classList.remove('is-open');
+ dashboardMenuPanel.classList.remove('is-open');
+ dashboardMenuPanel.hidden = true;
+}
+
+function toggleDashboardMenu() {
+ if (!dashboardMenuButton || !dashboardMenuPanel) return;
+ const isOpen = dashboardMenuButton.getAttribute('aria-expanded') === 'true';
+ dashboardMenuButton.setAttribute('aria-expanded', String(!isOpen));
+ dashboardMenuButton.classList.toggle('is-open', !isOpen);
+ dashboardMenuPanel.classList.toggle('is-open', !isOpen);
+ dashboardMenuPanel.hidden = isOpen;
+}
+
function updateAuthNav() {
const authenticated = MischLabsAuth.isAuthenticated();
const claims = MischLabsAuth.claims();
@@ -507,6 +526,24 @@ function updateAuthNav() {
}
}
+dashboardMenuButton?.addEventListener('click', (event) => {
+ event.stopPropagation();
+ toggleDashboardMenu();
+});
+
+document.addEventListener('click', (event) => {
+ if (!dashboardMenuPanel || dashboardMenuPanel.hidden) return;
+ if (!event.target.closest('.dashboard-menu')) {
+ closeDashboardMenu();
+ }
+});
+
+document.addEventListener('keydown', (event) => {
+ if (event.key === 'Escape') {
+ closeDashboardMenu();
+ }
+});
+
loginButton?.addEventListener('click', () => MischLabsAuth.login());
logoutButton?.addEventListener('click', () => MischLabsAuth.logout());
diff --git a/favorites.html b/favorites.html
index ba61185..b545422 100644
--- a/favorites.html
+++ b/favorites.html
@@ -12,7 +12,7 @@
-
+
diff --git a/index.html b/index.html
index f10c740..96672ef 100644
--- a/index.html
+++ b/index.html
@@ -15,7 +15,7 @@
-
+
@@ -135,6 +142,6 @@
-
+