Bugzilla – Attachment 193009 Details for
Bug 40896
Run report button should be disabled after click
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40896: (follow-up) Fix bfcache double-toggle on form button elements
Bug-40896-follow-up-Fix-bfcache-double-toggle-on-f.patch (text/plain), 1.97 KB, created by
Brendan Lawlor
on 2026-02-12 14:12:17 UTC
(
hide
)
Description:
Bug 40896: (follow-up) Fix bfcache double-toggle on form button elements
Filename:
MIME Type:
Creator:
Brendan Lawlor
Created:
2026-02-12 14:12:17 UTC
Size:
1.97 KB
patch
obsolete
>From 232c434254536d3b5331d7c3c94d7c0069379f6b Mon Sep 17 00:00:00 2001 >From: Paul Derscheid <paul.derscheid@lmscloud.de> >Date: Thu, 12 Feb 2026 09:52:37 +0100 >Subject: [PATCH] Bug 40896: (follow-up) Fix bfcache double-toggle on form > button elements > >- Track pending reset timeouts in a WeakMap keyed by element >- Clear any pending timeout in the pageshow handler before re-enabling >- Prevents the resumed setTimeout from re-disabling the button after > bfcache restoration > >Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> >--- > koha-tmpl/intranet-tmpl/prog/js/throttledButton.js | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/throttledButton.js b/koha-tmpl/intranet-tmpl/prog/js/throttledButton.js >index fe6b411b72..9ad563f647 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/throttledButton.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/throttledButton.js >@@ -1,5 +1,6 @@ > (() => { > const DEFAULT_TIMEOUT = 3000; >+ const pendingTimeouts = new WeakMap(); > > const toggleButton = element => { > const isDisabled = element.hasAttribute("disabled"); >@@ -53,7 +54,11 @@ > > requestAnimationFrame(() => { > toggleButton(submitter); >- setTimeout(() => toggleButton(submitter), timeout); >+ const timeoutId = setTimeout( >+ () => toggleButton(submitter), >+ timeout >+ ); >+ pendingTimeouts.set(submitter, timeoutId); > }); > } > }); >@@ -64,6 +69,11 @@ > document > .querySelectorAll("[data-throttled-button][disabled]") > .forEach(button => { >+ const timeoutId = pendingTimeouts.get(button); >+ if (timeoutId) { >+ clearTimeout(timeoutId); >+ pendingTimeouts.delete(button); >+ } > toggleButton(button); > }); > } >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40896
:
187044
|
187193
|
187512
|
188106
|
190457
|
190458
|
193001
|
193007
|
193008
|
193009
|
193114
|
193115
|
193116