From 700cc61dfaad162235a25c87a6d9c804a52c4209 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Thu, 25 Jul 2024 22:18:40 +0000 Subject: [PATCH] Bug 37373: If search_patron_filter is present set focus on it To test: 1- Go to a bib record (detail.pl) 2- click Holds on the left or Place a Hold above the title 3- note that on the next page (request.pl) your cursor is not in the box to search for a patron to place a hold 4- APPLY PATCH and clear browser cache 5- Try again, focus should be set on the patron search field --- koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js index ceaf8b8d57..874c3fbebb 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -62,7 +62,9 @@ $.fn.selectTabByID = function (tabID) { $(document).ready(function () { //check for a hash before setting focus let hash = window.location.hash; - if (!hash) { + if ( $('.search_patron_filter').length ) { + $('.search_patron_filter').focus() + } else if (!hash) { $(".tab-pane.active input:text:first").focus(); } $("#header_search a[data-toggle='tab']").on("shown.bs.tab", function (e) { -- 2.39.2