Refactor admin modals: replace backdrop divs with native <dialog> elements for improved accessibility and functionality
This commit is contained in:
1 parent
242c5165e1
commit
02551eebbc
8 files changed
+123
-106
No files matched your search
@@ -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');
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user