From 3f6d18c1641049295186d90475c38712fdad975f Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 13 Aug 2020 13:17:59 +0100 Subject: [PATCH] Bug 26039: Focus and Scroll to ShelfBrowser on load When the shelf browser link is clicked we perform a full page reload which results in a reset in the context. We should immediately focus the shelf browser and scroll to that region to highlight the change of content. --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index cc32512efd..55e4c0c069 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1583,6 +1583,15 @@ [% END %] [% IF ( OPACShelfBrowser ) %] + // Focus on shelf browser if present + var shelfbrowser = $("#shelfbrowser"); + if (shelfbrowser.length > 0) { + $('html,body').animate({ + scrollTop: shelfbrowser.first().offset().top + }, + 'slow'); + shelfbrowser.first().find(':focusable').eq(0).focus(); + } (function prepareShelfBrowser(){ -- 2.20.1