From 8191c840dd80314e7a41de44fa9ce57913c6cdac Mon Sep 17 00:00:00 2001 From: Paul Derscheid Date: Thu, 24 Oct 2024 14:57:04 +0000 Subject: [PATCH] Bug 38222: (follow-up) Only replace first numerical match in bookings count containers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sponsored-by: Büchereizentrale Schleswig-Holstein Signed-off-by: LEBSimonsen Signed-off-by: Martin Renvoize --- koha-tmpl/intranet-tmpl/prog/js/cancel_booking_modal.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/cancel_booking_modal.js b/koha-tmpl/intranet-tmpl/prog/js/cancel_booking_modal.js index 4cfdbafa1fc..d34196b1296 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/cancel_booking_modal.js +++ b/koha-tmpl/intranet-tmpl/prog/js/cancel_booking_modal.js @@ -60,7 +60,10 @@ return; } - bookingsCount.innerHTML = parseInt(bookingsCount.innerHTML, 10) - 1; + bookingsCount.innerHTML = bookingsCount.innerHTML.replace( + /\d+/, + match => parseInt(match, 10) - 1 + ); } function handleShowBsModal(e) { -- 2.47.0