]> git.ipfire.org Git - thirdparty/bulma.git/commitdiff
removed deprecated code 3660/head
authorGuiorgy <Guiorgy123@gmail.com>
Tue, 18 Jul 2023 13:07:03 +0000 (17:07 +0400)
committerGitHub <noreply@github.com>
Tue, 18 Jul 2023 13:07:03 +0000 (17:07 +0400)
removed `window.event`.
replaced `keyCode` with `code`.

docs/documentation/components/modal.html

index cfa82a456e3e13c2f7bb3af52726e898570091c1..1d570f90c94d113a2f2c2066f853bbd5d00d5cec 100644 (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();
     }
   });