Make button read the confirmation message

This commit is contained in:
Richard Schreiber
2025-06-02 22:10:09 +02:00
parent e3a4e280e1
commit 24b3c184c5
2 changed files with 10 additions and 17 deletions

View File

@@ -513,10 +513,12 @@
</form> </form>
<dialog role="alertdialog" id="cart-extend-feedback-dialog" aria-labelledby="cart-extend-feedback"> <dialog role="alertdialog" id="cart-extend-feedback-dialog" aria-labelledby="cart-extend-feedback">
<form method="dialog"> <form method="dialog">
<span id="cart-extend-feedback" class="text-muted"></span> <p>
<button class="btn btn-default" autofocus value="OK"> <span id="cart-extend-feedback" class="text-muted sr-only"></span>
{% icon "check" %} {% trans "OK" %} <button class="btn btn-default" autofocus value="OK">
</button> {% icon "check" %} {% trans "Reservation renewed" %}
</button>
</p>
</form> </form>
</dialog> </dialog>
{% else %} {% else %}

View File

@@ -106,20 +106,11 @@ var cart = {
$("#cart-deadline").attr("data-expires"), $("#cart-deadline").attr("data-expires"),
$("#cart-deadline").attr("data-max-expiry-extend") $("#cart-deadline").attr("data-max-expiry-extend")
); );
$("#cart-extend-feedback-dialog").on("close", function () { $("#cart-extend-feedback-dialog").on("keydown", function (e) {
if (this.returnValue) { // OK-Button has been pressed, nothing else has received focus // prevent enter or space-bar from bubbling up and closing the cart-panel
var cart_panel_heading = $(this).closest(".panel").find(".panel-heading").get(0); e.stopPropagation();
if (cart_panel_heading) {
window.setTimeout(function () {
cart_panel_heading.focus();
}, 50);
}
}
}).find("button").on("blur", function() { }).find("button").on("blur", function() {
var dialog = this.closest("dialog"); this.closest("dialog").close();
if (dialog.open) {
dialog.close();
}
}); });
}, },