Bugzilla – Attachment 135093 Details for
Bug 30640
Focus does not always move to correct search header form field
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30640: Focus does not always move to correct search header form field
Bug-30640-Focus-does-not-always-move-to-correct-se.patch (text/plain), 5.71 KB, created by
Séverine Queune
on 2022-05-18 08:24:47 UTC
(
hide
)
Description:
Bug 30640: Focus does not always move to correct search header form field
Filename:
MIME Type:
Creator:
Séverine Queune
Created:
2022-05-18 08:24:47 UTC
Size:
5.71 KB
patch
obsolete
>From 8a2118d131739983e3b9ce8bb8b7f6c6b8e67fe7 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 28 Apr 2022 11:37:31 +0000 >Subject: [PATCH] Bug 30640: Focus does not always move to correct search > header form field >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch updates the staff interface's global JavaScript to >accommodate changes in the way focus is being handled after the jQuery >upgrade (see: https://github.com/jquery/jquery/issues/4950). > >The "focus" class is removed from search header include files so that >there isn't a contradiction between which form field has the focus class >and which form field is displayed in the active tab. > >To test, apply the patch and view various pages in the staff interface. > >- On pages where focus is not being directed to a form field within the > main content of the page, the form field in the active search header > tab should have focus on page load: > > - Patron details > - System preferences > - Cities and towns > > Also test pages where a tab other than the first one is preselected: > > - Bibliographic details page > - Patron lists > > On these pages, focus should move to the active tab's form field when > you switch tabs. > >- On pages where focus is being sent to another form field, it should > work correctly: > > - Patrons home page > - Check in > - Acquisitions home page > >Signed-off-by: Séverine Queune <severine.queune@bulac.fr> >--- > .../intranet-tmpl/prog/en/includes/patron-search-box.inc | 4 ++-- > .../prog/en/includes/patron-search-header.inc | 2 +- > .../intranet-tmpl/prog/en/modules/admin/admin-home.tt | 8 -------- > koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 9 ++++++++- > 4 files changed, 11 insertions(+), 12 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc >index 726e39d30d..2dff1ba588 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc >@@ -4,7 +4,7 @@ > <label class="tip" for="findborrower">Enter patron card number or partial name:</label> > [% IF ( PatronAutoComplete ) %] > <div class="autocomplete"> >- <input autocomplete="off" id="findborrower" name="findborrower" size="40" class="head-searchbox focus" type="text" /> >+ <input autocomplete="off" id="findborrower" name="findborrower" size="40" class="head-searchbox" type="text" /> > <input id="autocsubmit" type="submit" class="submit" value="Submit" /> > [% IF ( stickyduedate ) %] > <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" /> >@@ -12,7 +12,7 @@ > [% END %] > </div> > [% ELSE %] >- <input id="findborrower" name="findborrower" size="40" class="head-searchbox focus" type="text" autocomplete="off" /> >+ <input id="findborrower" name="findborrower" size="40" class="head-searchbox" type="text" autocomplete="off" /> > [% IF ( stickyduedate ) %] > <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" /> > <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" /> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc >index f5e8dddcde..ff17ca9280 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc >@@ -11,7 +11,7 @@ > <form action="/cgi-bin/koha/members/member.pl" method="post"> > <label class="tip" for="searchmember">Enter patron card number or partial name:</label> > <div class="autocomplete"> >- <input id="searchmember" data-toggle="tooltip" size="25" class="head-searchbox focus" name="searchmember" type="text" value="[% searchmember | html %]" autocomplete="off" /> >+ <input id="searchmember" data-toggle="tooltip" size="25" class="head-searchbox" name="searchmember" type="text" value="[% searchmember | html %]" autocomplete="off" /> > <input type="hidden" name="quicksearch" value="1" /> > <span class="filteraction" id="filteraction_off"> <a href="#">[-]</a></span> > <span class="filteraction" id="filteraction_on"> <a href="#">[+]</a></span> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >index 1b99885b9a..cd15f66e04 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tt >@@ -275,12 +275,4 @@ > </div> > </div> > >-[% MACRO jsinclude BLOCK %] >- <script> >- $(document).ready(function(){ >- $("input[class='head-searchbox'][name='searchfield']").focus(); >- }); >- </script> >-[% END %] >- > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >index ad51b99e1b..f2becd2a7f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -49,7 +49,14 @@ $.fn.selectTabByID = function (tabID) { > }; > > $(document).ready(function() { >- $('#header_search').tabs().on( "tabsactivate", function() { $(this).find("div:visible").find('input').eq(0).focus(); }); >+ $('#header_search').tabs({ >+ create: function( e, ui ){ >+ ui.panel.find("input:text:first").focus(); >+ }, >+ activate: function ( e, ui ) { >+ ui.newPanel.find("input:text:first").focus(); >+ } >+ }); > > $(".close").click(function(){ window.close(); }); > >-- >2.30.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 30640
:
134224
|
135093
|
135095