mirror of
https://github.com/jgthms/bulma.git
synced 2024-11-14 11:14:24 +00:00
removed deprecated code
removed `window.event`. replaced `keyCode` with `code`.
This commit is contained in:
parent
11570110a9
commit
91547540aa
@ -120,9 +120,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
|
|
||||||
// Add a keyboard event to close all modals
|
// Add a keyboard event to close all modals
|
||||||
document.addEventListener('keydown', (event) => {
|
document.addEventListener('keydown', (event) => {
|
||||||
const e = event || window.event;
|
if (event.code === 'Escape') {
|
||||||
|
|
||||||
if (e.keyCode === 27) { // Escape key
|
|
||||||
closeAllModals();
|
closeAllModals();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user