Bugzilla – Attachment 187201 Details for
Bug 40783
The bookbag_form should not be submittable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40783: Result page checkbox now triggers click
Bug-40783-Result-page-checkbox-now-triggers-click.patch (text/plain), 1.94 KB, created by
Philip Orr
on 2025-10-01 15:10:35 UTC
(
hide
)
Description:
Bug 40783: Result page checkbox now triggers click
Filename:
MIME Type:
Creator:
Philip Orr
Created:
2025-10-01 15:10:35 UTC
Size:
1.94 KB
patch
obsolete
>From b996d78ba904a860faf1dfa002f2a1a9ab083a99 Mon Sep 17 00:00:00 2001 >From: Jake Deery <jake.deery@openfifth.co.uk> >Date: Tue, 23 Sep 2025 10:57:34 +0000 >Subject: [PATCH] Bug 40783: Result page checkbox now triggers click > >This patch changes the behaviour off the checkboxes on the results page, so that instead of causing a form submission (essentially, a page refresh), the checkbox will now follow the same behaviour as if it were clicked. > >TO TEST: >a) go to /cgi-bin/koha/opac-search.pl?idx=kw&q=history&sort_by=relevance >b) add an item to your cart (ensure the syspref is enabled) >c) tab through the results until you come across a checkbox, press >return >d) notice your page refreshes, as a form submission has happened >APPLY PATCH >e) repeat steps a-c >f) notice the page no longer refreshes, and that no form submission >occurs >g) notice that the checkbox is now checked, as if it had been clicked >h) notice the items are still in your cart and can be interacted with >normally >SIGN OFF > >Signed-off-by: John Doe <you@example.com> >--- > koha-tmpl/opac-tmpl/bootstrap/js/results-list.js | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/results-list.js b/koha-tmpl/opac-tmpl/bootstrap/js/results-list.js >index cb1889207a..0adde97cbd 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/results-list.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/results-list.js >@@ -127,8 +127,17 @@ function tagAdded() { > } > > $(document).ready(function () { >- $(".cb").click(function () { >- enableCheckboxActions(); >+ $('.cb').each((idx, element) => { >+ $(element).on('click', () => { >+ enableCheckboxActions(); >+ }); >+ $(element).on('keydown', event => { >+ if (event.key === 'Enter') { >+ event.preventDefault(); >+ $(element).trigger('click'); >+ return false; >+ } >+ }); > }); > enableCheckboxActions(); > >-- >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 40783
:
186311
|
186789
| 187201 |
187457