Download dialog redesign, code cleanup

This commit is contained in:
JeLuF
2023-06-28 19:11:37 +02:00
parent c425811b45
commit 9c34d42a50
7 changed files with 60 additions and 48 deletions

View File

@ -1055,3 +1055,14 @@ async function deleteKeys(keyToDelete) {
});
}
}
function modalDialogCloseOnBackdropClick(dialog) {
dialog.addEventListener('mousedown', function (event) {
var rect = dialog.getBoundingClientRect()
var isInDialog=(rect.top <= event.clientY && event.clientY <= rect.top + rect.height
&& rect.left <= event.clientX && event.clientX <= rect.left + rect.width)
if (!isInDialog) {
dialog.close()
}
})
}