From dd33718acb0617e0c6f0ee2fb728b1f81527027d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 6 Jan 2016 13:10:00 +0000 Subject: [PATCH] Bug 15119: Hide search header text boxes on render MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When the page rendering is slow or the page is heavy, the tabs in the header shown be not correctly displayed as tabs. This patch suggests to hide them, display the first one, and wait for the JS code to display them nicely. To easily reproduced the ergonomic issue, go on the circulation home page (/cgi-bin/koha/circ/circulation.pl) and search for a patron 'a' or 'd', you will get a lot of result and the page will be slow to be fully displayed. Signed-off-by: Hector Castro Works as advertised Signed-off-by: Owen Leonard Signed-off-by: Christopher Brannon Signed-off-by: Katrin Fischer Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com (cherry picked from commit 70eedf2217e1bfde1c56bc77c8dd0dc039124f47) Signed-off-by: Julian Maurice (cherry picked from commit 0d018647849724bacc40be7360e56a29c1a7fb53) Signed-off-by: Frédéric Demians --- koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css | 9 +++++++++ koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js | 2 ++ 2 files changed, 11 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index 15351a9ba9..31d6b9e735 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -2236,6 +2236,15 @@ ul.ui-tabs-nav li { border-radius: 0 0 4px 4px; } +#header_search > div, +#header_search > ul > li { + display: none; +} +#header_search > div:first-of-type, +#header_search > ul > li:first-of-type { + display: block; +} + .authref { font-style: normal; text-indent: 4em; diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js index 2636ec8d99..3b82219bb3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js @@ -33,6 +33,8 @@ $.fn.selectTabByID = function (tabID) { if($("#header_search #circ_search").length > 0){ shortcut.add('Alt+u',function (){ $("#header_search").selectTabByID("#circ_search"); $("#findborrower").focus(); }); } else { shortcut.add('Alt+u',function(){ location.href="/cgi-bin/koha/circ/circulation.pl"; }); } if($("#header_search #catalog_search").length > 0){ shortcut.add('Alt+q',function (){ $("#header_search").selectTabByID("#catalog_search"); $("#search-form").focus(); }); } else { shortcut.add('Alt+q',function(){ location.href="/cgi-bin/koha/catalogue/search.pl"; }); } + $("#header_search > ul > li").show(); + $(".focus").focus(); $(".validated").each(function() { $(this).validate(); -- 2.39.5