]> git.evergreen-ils.org Git - Evergreen.git/commit
Restore autofocus to the searchbar in TPAC
authorDan Scott <dscott@laurentian.ca>
Mon, 5 Mar 2012 04:15:58 +0000 (23:15 -0500)
committerMike Rylander <mrylander@gmail.com>
Wed, 7 Mar 2012 19:12:08 +0000 (14:12 -0500)
commit87e504ff83c87b05c7ecce744315404abf3ae0d7
treecf89e3b9c7a6e75ed50700a51520d00543e513be
parent15e6089f601dd12bfc11d4315ce46da9e56ad1e4
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 <dscott@laurentian.ca>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/templates/opac/parts/js.tt2
Open-ILS/src/templates/opac/parts/searchbar.tt2