diff --git a/_layouts/download-3.html b/_layouts/download-3.html index fe646926f3..c500369f49 100644 --- a/_layouts/download-3.html +++ b/_layouts/download-3.html @@ -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'; + } + }); }); diff --git a/_layouts/download.html b/_layouts/download.html index e9dfdcea03..7bd4f3d538 100644 --- a/_layouts/download.html +++ b/_layouts/download.html @@ -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'; + } + }); });