Bugzilla – Attachment 169445 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: Added clear button to global js
Bug-33668-Added-clear-button-to-global-js.patch (text/plain), 1.41 KB, created by
Roman Dolny
on 2024-07-23 21:16:17 UTC
(
hide
)
Description:
Bug 33668: Added clear button to global js
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2024-07-23 21:16:17 UTC
Size:
1.41 KB
patch
obsolete
>From 0f4482ce17d243b7703d574688f7a937c73f615c Mon Sep 17 00:00:00 2001 >From: Laura_Escamilla <laura.escamilla@bywatersolutions.com> >Date: Tue, 23 Jul 2024 19:30:36 +0000 >Subject: [PATCH] Bug 33668: Added clear button to global js > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > koha-tmpl/opac-tmpl/bootstrap/js/global.js | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/global.js b/koha-tmpl/opac-tmpl/bootstrap/js/global.js >index 694239e95a..715233b8ea 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/global.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/global.js >@@ -251,7 +251,22 @@ var facetHandler = function (e) { > > function setPlaceholder(){ > let search_placeholder = $("#masthead_search option:selected").data("placeholder"); >- $("#translControl1").attr("placeholder", search_placeholder ); >+ let clearButton = $('<span class="clear-search"><i class="fa-sharp fa-regular fa-circle-xmark"></i></span>'); >+ >+ $("#translControl1").attr("placeholder", search_placeholder ).after(clearButton); >+ >+ clearButton.click(function() { >+ $("#translControl1").val('').focus(); >+ $(this).hide(); >+ }); >+ >+ $("#translControl1").on('input', function() { >+ if ($(this).val() !== '') { >+ clearButton.show(); >+ } else { >+ clearButton.hide(); >+ } >+ }); > } > > $(document).ready(function(){ >-- >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