Allow keyboard navigation on donation dialog

This commit is contained in:
Emi
2024-08-02 16:19:56 +02:00
parent 1e04972668
commit 2167a80780
2 changed files with 16 additions and 0 deletions

View File

@@ -327,6 +327,7 @@ layout: default
downloadButtons.forEach((it) => {
it.addEventListener('click', () => {
thankYouWrapper.style.display = '';
document.querySelector('.btn.btn-donate').focus();
});
});
@@ -337,6 +338,13 @@ layout: default
thankYouWrapper.style.display = '';
});
});
// Close the dialog when the user presses the escape key.
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') {
thankYouWrapper.style.display = 'none';
}
});
});
</script>

View File

@@ -314,6 +314,7 @@ layout: default
downloadButtons.forEach((it) => {
it.addEventListener('click', () => {
thankYouWrapper.style.display = '';
document.querySelector('.btn.btn-donate').focus();
});
});
@@ -324,6 +325,13 @@ layout: default
thankYouWrapper.style.display = '';
});
});
// Close the dialog when the user presses the escape key.
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') {
thankYouWrapper.style.display = 'none';
}
});
});
</script>