Bugzilla – Attachment 169760 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) Modify the JS logic behind the 'Clear search' button
Bug-33668-follow-up-Modify-the-JS-logic-behind-the.patch (text/plain), 1.91 KB, created by
Roman Dolny
on 2024-07-26 16:32:37 UTC
(
hide
)
Description:
Bug 33668: (follow-up) Modify the JS logic behind the 'Clear search' button
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2024-07-26 16:32:37 UTC
Size:
1.91 KB
patch
obsolete
>From 1692be0babab0972cdde73d521b384ec14ea18d9 Mon Sep 17 00:00:00 2001 >From: Andreas Roussos <a.roussos@dataly.gr> >Date: Wed, 24 Jul 2024 22:59:45 +0000 >Subject: [PATCH] Bug 33668: (follow-up) Modify the JS logic behind the 'Clear > search' button > >When the OPAC main page first loads and the search <input> is >empty, the 'X' (Clear search) button is displayed anyway. This >can potentially cause some UX confusion involving the presence >of an 'X' button inside an otherwise empty search box. > >This patch fixes that in a way that doesn't affect the display >of the 'X' button after performing an actual search. > >Test plan: > >1) Without this patch applied, visit the OPAC main page. > Notice that even though there's nothing in the search box > yet, the 'Clear search' button is displayed anyway. > >2) Apply this patch / reload all JavaScript assets (CTRL+F5). > >3) Notice that the 'Clear search' button is no longer visible > when the search box is empty. > >4) Type something in the search box: notice that the 'X' > button appears. > >5) Use the 'X' button to clear your search: the search > terms are cleared and the 'X' button hides itself. > >6) Perform an actual search and in the results page notice > that the 'X' button remains visible. > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > koha-tmpl/opac-tmpl/bootstrap/js/global.js | 4 ++++ > 1 file changed, 4 insertions(+) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/global.js b/koha-tmpl/opac-tmpl/bootstrap/js/global.js >index 0f939c3d24..5fbbc2c077 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/global.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/global.js >@@ -255,6 +255,10 @@ function setPlaceholder(){ > > $("#translControl1").attr("placeholder", search_placeholder).after(clearButton); > >+ if ($("#translControl1").val() == '') { >+ clearButton.hide(); >+ } >+ > clearButton.click(function() { > $("#translControl1").val('').focus(); > $(this).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
|
176579
|
176580
|
176813
|
176814
|
176815
|
176816
|
176817
|
176818
|
176819