feat: hover Coordinator menu; pages named by their own heading
- The Coordinator pill is a real link to Shifts (/admin) and opens the Shifts / Contacts / Settings card on hover or keyboard focus (desktop). Esc closes it. Phones and tablets keep the second row in the menu overlay. - Menu links no longer scale on hover, so the blue highlight stays inside the card. - No gold "current page" line in the menu, the phone row, or the pill; aria-current stays for screen readers. The page heading shows where you are. - The dashboard heading and title are "Shifts". Breadcrumbs start at their section: Shifts > ..., Contacts > Name, Settings > Administrators. - tests: admins.test.ts updated for the new markup.
This commit is contained in:
1 parent
c576613b9d
commit
bf3724d531
6 files changed
+49
-101
No files matched your search
+12
-1
@@ -2,6 +2,7 @@
|
||||
bindNav();
|
||||
bindCalendar();
|
||||
bindViewMenu();
|
||||
bindCoordMenu();
|
||||
bindManage();
|
||||
bindSignupDates();
|
||||
document.querySelectorAll('[data-contact]').forEach(bindContact);
|
||||
@@ -27,7 +28,7 @@
|
||||
}
|
||||
|
||||
function bindViewMenu() {
|
||||
var menus = document.querySelectorAll('details.view-menu, details.manage-menu, details.coord-menu');
|
||||
var menus = document.querySelectorAll('details.view-menu, details.manage-menu');
|
||||
if (!menus.length) return;
|
||||
document.addEventListener('click', function (event) {
|
||||
for (var i = 0; i < menus.length; i += 1) {
|
||||
@@ -41,6 +42,16 @@
|
||||
});
|
||||
}
|
||||
|
||||
function bindCoordMenu() {
|
||||
var menu = document.querySelector('.coord-menu');
|
||||
if (!menu) return;
|
||||
menu.addEventListener('keydown', function (event) {
|
||||
if (event.key !== 'Escape') return;
|
||||
var active = document.activeElement;
|
||||
if (active && menu.contains(active)) active.blur();
|
||||
});
|
||||
}
|
||||
|
||||
function bindCalendar() {
|
||||
var calendar = document.querySelector('.shift-calendar');
|
||||
var weeks = document.querySelectorAll('.cal-week');
|
||||
|
||||
Reference in new issue
Block a user