From: Dan Scott Date: Mon, 5 Mar 2012 04:15:58 +0000 (-0500) Subject: Restore autofocus to the searchbar in TPAC X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=87e504ff83c87b05c7ecce744315404abf3ae0d7;p=contrib%2FConifer.git Restore autofocus to the searchbar in TPAC The switch to autosuggest gave us great functionality, but we lost autofocus for effortless initial searching. Restore it, with and without Dojo. For the latter case, just use HTML5's autofocus attribute to begin with; later on we can use something like Modernizr to detect browsers that don't support this attribute and prop them up with additional JavaScript, but let's not let that prevent us from getting a good bang for our attribute buck in the short term. Note the slightly painful workaround required to get the cursor to position itself at the end of the input value of the Dojo autosuggest widget on page load. This is what we get for stepping back into the world of JavaScript :) Signed-off-by: Dan Scott Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/templates/opac/parts/js.tt2 b/Open-ILS/src/templates/opac/parts/js.tt2 index 8d00df5345..a7bc5677e2 100644 --- a/Open-ILS/src/templates/opac/parts/js.tt2 +++ b/Open-ILS/src/templates/opac/parts/js.tt2 @@ -61,6 +61,18 @@ [% IF use_autosuggest.enabled == "t"; %] [% END; # use_autosuggest %] diff --git a/Open-ILS/src/templates/opac/parts/searchbar.tt2 b/Open-ILS/src/templates/opac/parts/searchbar.tt2 index 80b55eeb8d..3c12bd9268 100644 --- a/Open-ILS/src/templates/opac/parts/searchbar.tt2 +++ b/Open-ILS/src/templates/opac/parts/searchbar.tt2 @@ -24,7 +24,7 @@ store_args='{"org_unit_getter": function() { return [% ctx.search_ou %]; }}' [%- END # opac_visible -%] [%- ELSE -%] - x-webkit-speech + autofocus x-webkit-speech [%- END # autosuggest enabled %] /> [%- INCLUDE "opac/parts/qtype_selector.tt2" id="qtype";