Bug 22768: Global search form keyboard navigation broken

Bug 22045 made changes to the global staff client JavaScript which
broken keyboard navigation for the most common forms in the resident
search form("Check out, Check in, Renew, Search). This patch
reimplements the tab selection code on the basic MARC editor page so
that the keyboard shortcut behavior can be restored.

To test, apply the patch go to Cataloging.

 - Search for an existing record and edit it in the basic MARC editor.
   - Test that the numbered tabs (0-9) at the top work correctly.
 - Select a tab other than 0 and choose Save -> Save and continue
   editing. When the page reloads you should be returned to the tab you
   were on when you saved.
 - Go to the Circulation home page. Test the keyboard shortcuts for
   switching tabs in header area:

   - Alt-u (Check out)
   - Alt-r (Check in)
   - Alt-w (Renew)
   - Alt-q (Search)

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Signed-off-by: Nadine Pierre <nadine.pierre@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Owen Leonard 2019-04-25 11:45:58 +00:00 committed by Martin Renvoize
parent 08a86c2335
commit bb3a0e5dbc
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
2 changed files with 13 additions and 8 deletions

View File

@ -28,7 +28,8 @@
});
[% IF tab %]
$('#addbibliotabs').selectTabByID("tab[% tab | html %]");
link = $("a[href='#[% tab | html %]']");
selectTab( link );
[% END %]
Sticky = $("#toolbar");
@ -136,12 +137,7 @@
$(".toolbar-tabs a").on("click",function(e){
e.preventDefault();
$(".toolbar-tabs li").removeClass("selected");
$(this).parent().addClass("selected");
var tabid = $(this).data("tabid");
$('#addbibliotabs').selectTabByID("tab" + tabid + "XX");
$(".tag_anchors").removeClass("tab_selected").hide();
$(".tag_anchors_" + tabid ).addClass("tab_selected").show();
selectTab( $(this ) );
});
$(".tag_anchor").on("click", function(e){
@ -158,6 +154,15 @@
});
function selectTab( tablink ){
$(".toolbar-tabs li").removeClass("selected");
tablink.parent().addClass("selected");
var tabid = tablink.data("tabid");
$('#addbibliotabs').selectTabByID("#tab" + tabid + "XX");
$(".tag_anchors").removeClass("tab_selected").hide();
$(".tag_anchors_" + tabid ).addClass("tab_selected").show();
}
function redirect(dest){
$("#redirect").attr("value",dest);
return Check();

View File

@ -31,7 +31,7 @@ $.fn.tabIndex = function () {
return $(this).parent().children('div').index(this);
};
$.fn.selectTabByID = function (tabID) {
$(this).tabs("option", "active", $( "#" + tabID ).tabIndex());
$(this).tabs("option", "active", $( tabID ).tabIndex());
};
$(document).ready(function() {