removed deprecated code

removed `window.event`.
replaced `keyCode` with `code`.
This commit is contained in:
Guiorgy 2023-07-18 17:07:03 +04:00 committed by GitHub
parent 11570110a9
commit 91547540aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,9 +120,7 @@ document.addEventListener('DOMContentLoaded', () => {
// Add a keyboard event to close all modals
document.addEventListener('keydown', (event) => {
const e = event || window.event;
if (e.keyCode === 27) { // Escape key
if (event.code === 'Escape') {
closeAllModals();
}
});