Bugzilla – Attachment 186248 Details for
Bug 38643
Advanced Search input fields need placeholders
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38643: Added JS for the dynamic placeholders
Bug-38643-Added-JS-for-the-dynamic-placeholders.patch (text/plain), 2.05 KB, created by
Ludovic
on 2025-09-05 20:12:46 UTC
(
hide
)
Description:
Bug 38643: Added JS for the dynamic placeholders
Filename:
MIME Type:
Creator:
Ludovic
Created:
2025-09-05 20:12:46 UTC
Size:
2.05 KB
patch
obsolete
>From 541fef049f436ba59f37932bffaffddc9df818fc Mon Sep 17 00:00:00 2001 >From: Laura_Escamilla <laura.escamilla@bywatersolutions.com> >Date: Fri, 29 Aug 2025 15:56:49 +0000 >Subject: [PATCH] Bug 38643: Added JS for the dynamic placeholders >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >To test: > >1. Visit http://localhost:8080/cgi-bin/koha/opac-main.pl â notice that the main search bar has a placeholder. >2. Visit the advanced search page. Notice that the search bars in the advanced search do not have placeholders. >3. Apply this patch. restart_all >4. Refresh the page on the advanced search. Notice that the search bars now have placeholders. Try switching out the dropdown options and notice that the placeholder text changes depending on what you select. >5. Test searches and make sure everything works as expected. >6. Sign off â have an amazing day! :D > >Signed-off-by: Ludovic <ludovic.julien@inlibro.com> >--- > koha-tmpl/opac-tmpl/bootstrap/js/global.js | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/global.js b/koha-tmpl/opac-tmpl/bootstrap/js/global.js >index 15fc44db361..1c980d7d405 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/global.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/global.js >@@ -265,6 +265,22 @@ function setPlaceholder() { > $("#translControl1").attr("placeholder", search_placeholder); > } > >+function setAdvancedPlaceholder(selectEl) { >+ var $select = $(selectEl); >+ var $row = $select.closest(".search-term-row"); >+ var $input = $row.find("input[name='q']"); >+ var ph = $select.find("option:selected").data("placeholder"); >+ $input.attr("placeholder", ph || _("Enter search terms")); >+} >+ >+$(".advanced-search-terms select[name='idx']").each(function () { >+ setAdvancedPlaceholder(this); >+}); >+ >+$(".advanced-search-terms").on("change", "select[name='idx']", function () { >+ setAdvancedPlaceholder(this); >+}); >+ > $(document).ready(function () { > //check if sticky element is stuck, if so add floating class > if ($(".sticky").length) { >-- >2.43.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 38643
:
185940
|
185941
| 186248