Binded closeDialogue to esc

In that way the user can exit a dialogue without using the button and the mouse
This commit is contained in:
Nicola
2021-12-12 23:08:13 +01:00
parent 8433b6018a
commit 8abe1f04bb
2 changed files with 4 additions and 3 deletions

View File

@@ -8,6 +8,8 @@ const Dialogue = (() => {
const popUpContainer = document.getElementById("pop-up-container");
const cancelButtons = popUpContainer.getElementsByClassName('close-button');
Events.onCustom("esc-pressed", closeDialogue);
// Add click handlers for all cancel buttons
for (var i = 0; i < cancelButtons.length; i++) {
cancelButtons[i].addEventListener('click', function () {