Refactor admin modals: replace backdrop divs with native <dialog> elements for improved accessibility and functionality

This commit is contained in:
David Dyer committed 2026-10-25 13:08:40 -04:00
1 parent 242c5165e1
commit 02551eebbc
8 files changed
+123 -106

No files matched your search

+11
View File
@@ -42,3 +42,14 @@ document.addEventListener('submit', (e) => {
e.preventDefault();
}
});
// Announcement editor dialog: the server flags it for ?new / ?edit URLs.
// Closing it any way (× link, Esc) drops the query string, so a reload
// doesn't reopen it.
const annModal = document.getElementById('modal-ann');
if (annModal?.hasAttribute('data-open-on-load')) {
annModal.showModal();
annModal.addEventListener('close', () => {
history.replaceState(null, '', 'index.php');
});
}