taler-merchant-demos

Python-based Frontends for the Demonstration Web site
Log | Files | Refs | Submodules | README | LICENSE

commit 489382635f463f04514aca93c8c5acfa4defa499
parent 0b806cd4f95090b0b9a67b27ac91515c8c5a9c42
Author: Sebastian <sebasjm@gmail.com>
Date:   Wed, 19 Oct 2022 00:25:25 -0300

fix #7384

Diffstat:
Mtalermerchantdemos/templates/common-base.html.j2 | 16+++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/talermerchantdemos/templates/common-base.html.j2 b/talermerchantdemos/templates/common-base.html.j2 @@ -22,9 +22,22 @@ <link rel="stylesheet" type="text/css" href="{{ static('demo.css') }}" /> {% block head %} {% endblock %} + <script> + function resetState() { + document.getElementById("lang").classList.add("hide"); + } + function bodyKeyPress(event) { + if (event.code === "Escape") { + resetState(); + } + } + function bodyOnClick(event) { + resetState(); + } + </script> </head> -<body> +<body onkeydown="bodyKeyPress(event)" onclick="bodyOnClick(event)"> <header class="demobar" style="display: flex; flex-direction: row; justify-content: space-between;"> <a href="#main" class="skip">Skip to main content</a> <div style="max-width: 50em; margin-left: 2em;"> @@ -59,6 +72,7 @@ function handleLang(event){ if (event.type === 'click') { document.getElementById("lang").classList.toggle("hide"); + event.stopPropagation(); } } </script>