Change autofocus for public catalog user/bshum/change-autofocus
authorBen Shum <bshum@biblio.org>
Wed, 4 Nov 2015 20:50:25 +0000 (15:50 -0500)
committerBen Shum <bshum@biblio.org>
Wed, 4 Nov 2015 20:57:59 +0000 (15:57 -0500)
Only autofocus the basic search on the home page when you first arrive
to the online public catalog. This allows users to use the up/down arrows
to navigate the catalog search results.

Retain original functionality for the staff client for now.

Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/templates/opac/home.tt2
Open-ILS/src/templates/opac/parts/searchbar.tt2

index 3257ba4..017e555 100644 (file)
@@ -3,7 +3,7 @@
     INCLUDE "opac/parts/topnav.tt2";
     ctx.page_title = l("Home") %]
     <h2 class="sr-only">[% l('Catalog Home') %]</h2>
-    [% INCLUDE "opac/parts/searchbar.tt2" %]
+    [% INCLUDE "opac/parts/searchbar.tt2" autofocus_on='t' %]
     <div id="content-wrapper">
         <div id="main-content-home">
             <div class="common-full-pad"></div>
index c2d2710..7fd93b0 100644 (file)
@@ -25,7 +25,7 @@
                 store_args='{"org_unit_getter": function() { return [% ctx.search_ou %]; }}'
                 [%-     END # opac_visible -%]
                 [%- ELSE -%]
-                    [% IF basic_search != "f" %] autofocus [% END %] x-webkit-speech
+                    [% IF (basic_search != "f" AND ctx.is_staff) OR autofocus_on == "t" %] autofocus [% END %] x-webkit-speech
                 [%- END # autosuggest enabled %] />
             </label>
         </span>