Bug 15119: Hide search header text boxes on render
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 6 Jan 2016 13:10:00 +0000 (13:10 +0000)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Wed, 23 Mar 2016 00:02:01 +0000 (00:02 +0000)
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 <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js

index 25a940c..27105c0 100644 (file)
@@ -2286,6 +2286,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;
index 6049fbc..599a3bd 100644 (file)
@@ -34,6 +34,8 @@ $.fn.selectTabByID = function (tabID) {
     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"; }); }
     if($("#header_search #renew_search").length > 0){ shortcut.add('Alt+y',function (){ $("#header_search").selectTabByID("#renew_search"); $("#ren_barcode").focus(); }); } else { shortcut.add('Alt+y',function(){ location.href="/cgi-bin/koha/circ/renew.pl"; }); }
 
+    $("#header_search > ul > li").show();
+
     $(".focus").focus();
     $(".validated").each(function() {
         $(this).validate();