From 77fb8b9780a6b323ff3424a710c7301a3ffed294 Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Sun, 1 Feb 2026 08:18:36 -0800 Subject: [PATCH] Add user dropdown menu with Settings and Logout options The user icon in the top-right header now opens a dropdown with Settings and Logout links, making both accessible on mobile where the sidebar is hidden. Co-Authored-By: Claude Opus 4.5 --- portal/index.html | 14 ++++++++++++-- portal/portal.js | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/portal/index.html b/portal/index.html index 14cb578..c37691f 100644 --- a/portal/index.html +++ b/portal/index.html @@ -139,10 +139,20 @@ - diff --git a/portal/portal.js b/portal/portal.js index 89236f8..fb24814 100644 --- a/portal/portal.js +++ b/portal/portal.js @@ -128,6 +128,24 @@ const Portal = { } }, + // Toggle user dropdown menu + toggleUserMenu() { + const dd = document.getElementById('userDropdown'); + if (!dd) return; + const showing = dd.style.display !== 'none'; + dd.style.display = showing ? 'none' : 'block'; + if (!showing) { + // Close on outside click + const close = (e) => { + if (!dd.contains(e.target) && e.target.id !== 'userBtn' && !e.target.closest('#userBtn')) { + dd.style.display = 'none'; + document.removeEventListener('click', close); + } + }; + setTimeout(() => document.addEventListener('click', close), 0); + } + }, + // Logout logout() { localStorage.removeItem('payfrit_portal_token');