From 92a62ed9b1b59b3575558fb53793b0f32a6b4055 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 --- 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 4cfdbafa1f..d34196b129 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