feat: dialogs open and close smoothly, the backdrop fading with them

This commit is contained in:
redtea committed 2026-10-15 10:38:02 +03:00
1 parent b47e824692
commit dbb46173a3
4 files changed
+14 -10

No files matched your search

+2 -2
View File
@@ -732,8 +732,8 @@
// then runs once the dialog is shut and focus is back where it was, so
// what it focuses stays focused.
function close(then) {
d.classList.add('closing');
setTimeout(() => { d.classList.remove('closing'); d.close(); if (then) then(); }, 160);
d.close();
if (then) then();
}
d.addEventListener('cancel', ev => { ev.preventDefault(); close(); });
d.addEventListener('click', ev => { if (ev.target === d) close(); });