Bugzilla – Attachment 169761 Details for
Bug 33668
Add a 'clear search' button/icon inside the search input box on the OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33668: (follow-up) Ensure the clear button is added to the DOM only once
Bug-33668-follow-up-Ensure-the-clear-button-is-add.patch (text/plain), 2.15 KB, created by
Roman Dolny
on 2024-07-26 16:32:40 UTC
(
hide
)
Description:
Bug 33668: (follow-up) Ensure the clear button is added to the DOM only once
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2024-07-26 16:32:40 UTC
Size:
2.15 KB
patch
obsolete
>From 7d3266f775e490d9255e1177ca2167ddc6b71d9d Mon Sep 17 00:00:00 2001 >From: Andreas Roussos <a.roussos@dataly.gr> >Date: Fri, 26 Jul 2024 13:12:01 +0000 >Subject: [PATCH] Bug 33668: (follow-up) Ensure the clear button is added to > the DOM only once > >Every time the OPAC search dropdown menu is used to select a >specific search type (by keyword/Title/Author/ISBN/etc.), the >'Clear search' button HTML code is re-added to the DOM. > >This has the side effect of multiple presses of the 'X' button >being required in order to hide it. > >Test plan: > >1) Without this patch applied, use the dropdown menu adjacent > to the OPAC search box to select a specific search type. > Make, for example, 3 changes in a row (because you can't > make up your mind). > >2) Type something in the search box: notice that the 'X' > button appears. Now click on the 'X' button: notice that > it doesn't go away immediately, but requires as many clicks > as the number of times you selected a search type in step 1. > >3) Apply the patch and perform a hard refresh (CTRL+F5) on > the OPAC main page to reload all JavaScript assets. > >4) Repeat steps 1 and 2 -- this time the 'X' button should > hide itself immediately when you first click on it. > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > koha-tmpl/opac-tmpl/bootstrap/js/global.js | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/global.js b/koha-tmpl/opac-tmpl/bootstrap/js/global.js >index 5fbbc2c077..fe26a15b94 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/global.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/global.js >@@ -253,7 +253,11 @@ function setPlaceholder(){ > let search_placeholder = $("#masthead_search option:selected").data("placeholder"); > let clearButton = $('<span class="clear-search"><i class="fa-solid fa-square-xmark"></i></span>'); > >- $("#translControl1").attr("placeholder", search_placeholder).after(clearButton); >+ $("#translControl1").attr("placeholder", search_placeholder); >+ >+ if ($(".clear-search").length == 0) { >+ $("#translControl1").after(clearButton); >+ } > > if ($("#translControl1").val() == '') { > clearButton.hide(); >-- >2.39.2
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 33668
:
150602
|
169443
|
169444
|
169445
|
169446
|
169525
|
169526
|
169527
|
169528
|
169529
|
169530
|
169531
|
169532
|
169533
|
169534
|
169716
|
169717
|
169755
|
169756
|
169757
|
169758
|
169759
|
169760
| 169761