Bugzilla – Attachment 152677 Details for
Bug 34005
Toggling the search term highlighting is not always working in the bibliographic record details page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34005: Move button toggling code outside JS for loop
Bug-34005-Move-button-toggling-code-outside-JS-for.patch (text/plain), 2.45 KB, created by
Martin Renvoize (ashimema)
on 2023-06-26 11:17:09 UTC
(
hide
)
Description:
Bug 34005: Move button toggling code outside JS for loop
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-06-26 11:17:09 UTC
Size:
2.45 KB
patch
obsolete
>From 46b45092cbc1b9fb9b19bdc3a5647eafde645516 Mon Sep 17 00:00:00 2001 >From: Andreas Roussos <a.roussos@dataly.gr> >Date: Wed, 14 Jun 2023 14:00:15 +0000 >Subject: [PATCH] Bug 34005: Move button toggling code outside JS for loop > >When OpacHighlightedWords is set to "Highlight", if you search >in the OPAC and the number of keywords is odd (1, 3, 5, etc.), >then the "Unhighlight" / "Highlight" button will stop working >after a couple of clicks. The relevant commit is 9cb89b46397 >from v20.11.00, where the code responsible for toggling the >"Unhighlight" / "Highlight" button was moved inside the JS >for loop that cycles through each term in the array of search >terms. This explains why the toggling only works when an even >number of search terms is being used. > >This patch fixes that, by placing the button toggling code in >its original position (outside the JavaScript for loop of the >highlightOn() function). > >Test plan: > >0) If required, set OpacHighlightedWords to "Highlight". > >1) Search for "history" in the OPAC, and view the details page > of one of the results. Click on the "Unhighlight" button a > few times -- after a couple of clicks the button text will > stop toggling and you won't be able to remove the keyword > highlight any more. > >2) Apply this patch. > >3) Repeat step 1): this time you should be able to toggle the > search keyword highlighting no matter how many times you > click on the "Unhighlight" / "Highlight" button. > >4) Repeat step 1), but this time search for "century history": > you should be able to toggle search keyword highlighting in > the details page on and off repeatedly without any problems. > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index 59b4c05391..8449cc3b86 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -1489,8 +1489,8 @@ > $(".results_summary").highlight(q_array[x]); > } > } >- $(".highlight_toggle").toggle(); > } >+ $(".highlight_toggle").toggle(); > } > [% END # /IF OpacHighlightedWords %] > >-- >2.41.0
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 34005
:
152337
|
152338
| 152677