mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-10 05:48:36 +01:00
add escape buttono to close the popup
This commit is contained in:
parent
2e7a43ad7c
commit
312f717713
1 changed files with 6 additions and 0 deletions
|
@ -1678,6 +1678,12 @@ document.getElementById('search').addEventListener('keyup', function () {
|
|||
event.preventDefault();
|
||||
togglePopup();
|
||||
});
|
||||
|
||||
document.addEventListener('keydown', function (event) {
|
||||
if (event.key === 'Escape' && isPopupOpen) {
|
||||
closePopup();
|
||||
}
|
||||
});
|
||||
// @license-end
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue