Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules
Andreas Roussos 3a550c39cb
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 9cb89b4639
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 55f3eb3919)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-18 10:24:32 +01:00
..
clubs Bug 32341: (follow-up) Making the remains OPAC tables responsive 2023-07-12 07:56:39 +01:00
errors
sci
sco
svc
ilsdi.tt
maintenance.tt
opac-account-pay-error.tt
opac-account.tt Bug 32341: (follow-up) Add responsivity to Curbside pickups table and changing button style for finestables 2023-07-12 07:56:39 +01:00
opac-addbybiblionumber.tt
opac-advsearch.tt Bug 33891: Use template wrapper for tabs: OPAC advanced search 2023-06-09 11:22:18 -03:00
opac-alert-subscribe.tt
opac-auth-detail.tt Bug 33892: Use template wrapper for tabs: OPAC authority detail 2023-06-09 12:04:53 -03:00
opac-auth-MARCdetail.tt
opac-auth.tt Bug 33343: Make use of the 'autocomplete=off' attribute on password fields 2023-06-09 12:04:56 -03:00
opac-authorities-home.tt
opac-authoritiessearchresultlist.tt Bug 32341: (follow-up) Making the remains OPAC tables responsive 2023-07-12 07:56:39 +01:00
opac-basket.tt
opac-blocked.tt
opac-browse.tt
opac-browser.tt
opac-course-details.tt Bug 32341: (follow-up) Making the remains OPAC tables responsive 2023-07-12 07:56:39 +01:00
opac-course-reserves.tt Bug 32341: (follow-up) Making the remains OPAC tables responsive 2023-07-12 07:56:39 +01:00
opac-curbside-pickups.tt Bug 32341: (follow-up) Add responsivity to Curbside pickups table and changing button style for finestables 2023-07-12 07:56:39 +01:00
opac-detail.tt Bug 34005: Move button toggling code outside JS for loop 2023-07-18 10:24:32 +01:00
opac-discharge.tt
opac-downloadcart.tt
opac-downloadshelf.tt
opac-full-serial-issues.tt Bug 32752: Use an include for displaying the serial status in the OPAC 2023-05-15 18:24:06 -03:00
opac-holdshistory.tt
opac-ics.tt
opac-idref.tt
opac-illrequests.tt
opac-imageviewer.tt
opac-ISBDdetail.tt
opac-issue-note.tt
opac-library.tt
opac-main.tt
opac-MARCdetail.tt
opac-memberentry-update-submitted.tt
opac-memberentry.tt Bug 33343: Catch more cases and correctly use new-password hint 2023-06-09 12:04:57 -03:00
opac-messaging.tt Bug 32341: (follow-up) Making the remains OPAC tables responsive 2023-07-12 07:56:39 +01:00
opac-mymessages.tt
opac-news-rss.tt
opac-opensearch.tt
opac-overdrive-search.tt
opac-page.tt
opac-passwd.tt Bug 33343: Catch more cases and correctly use new-password hint 2023-06-09 12:04:57 -03:00
opac-password-recovery.tt Bug 33343: Make use of the 'autocomplete=off' attribute on password fields 2023-06-09 12:04:56 -03:00
opac-patron-consent.tt
opac-privacy.tt
opac-readingrecord.tt Bug 32341: (follow-up) Making the remains OPAC tables responsive 2023-07-12 07:56:39 +01:00
opac-recall.tt
opac-recalls.tt Bug 32341: (follow-up) Making the remains OPAC tables responsive 2023-07-12 07:56:39 +01:00
opac-registration-confirmation.tt Bug 33343: Make use of the 'autocomplete=off' attribute on password fields 2023-06-09 12:04:56 -03:00
opac-registration-email-sent.tt
opac-registration-invalid.tt
opac-reportproblem.tt
opac-request-article.tt
opac-reserve.tt
opac-reset-password.tt Bug 33343: Catch more cases and correctly use new-password hint 2023-06-09 12:04:57 -03:00
opac-restrictedpage.tt
opac-results.tt Bug 33697: Remove RecordedBooks (rbdigital) integration 2023-06-09 11:22:15 -03:00
opac-retrieve-file.tt
opac-review.tt
opac-routing-lists.tt
opac-search-history.tt Bug 33894: Use template wrapper for tabs: OPAC search history 2023-07-17 14:51:44 +01:00
opac-sendbasketform.tt
opac-sendshelfform.tt
opac-serial-issues.tt
opac-shareshelf.tt
opac-shelves-rss.tt
opac-shelves.tt Bug 32402: Add "Modification date" to OPAC Lists table 2023-07-17 13:09:48 +01:00
opac-showmarc.tt
opac-showreviews-rss.tt
opac-showreviews.tt
opac-suggestions.tt
opac-tags.tt
opac-tags_subject.tt
opac-topissues.tt
opac-user.tt Bug 33781: Terminology: Item already issued to other borrower. 2023-07-18 10:06:24 +01:00