event listener for esc keypress
This commit is contained in:
1 parent
70662fee62
commit
0f82f4865f
3 files changed
+23
-1
No files matched your search
@@ -229,6 +229,17 @@ mailgoInit = () => {
|
||||
},
|
||||
false
|
||||
);
|
||||
|
||||
// allow the escape key to hide the modal
|
||||
mailgo.addEventListener(
|
||||
"keydown",
|
||||
event => {
|
||||
if (event.keyCode === 27) {
|
||||
mailgo.nextElementSibling.classList.remove("is-active");
|
||||
}
|
||||
},
|
||||
false
|
||||
);
|
||||
|
||||
// every click outside the modal will hide the modal
|
||||
modalBackground.addEventListener(
|
||||
|
||||
Reference in new issue
Block a user