feat: dialogs open and close smoothly, the backdrop fading with them
This commit is contained in:
1 parent
b47e824692
commit
dbb46173a3
4 files changed
+14
-10
No files matched your search
@@ -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(); });
|
||||
|
||||
Reference in new issue
Block a user