TPAC: AutoSuggest throws a JS error on login form
authorDan Scott <dscott@laurentian.ca>
Mon, 13 Aug 2012 19:51:35 +0000 (15:51 -0400)
committerDan Scott <dscott@laurentian.ca>
Mon, 13 Aug 2012 20:24:50 +0000 (16:24 -0400)
commit35ec0401f884665d53b1c3e28588c3fc28b5c094
tree61a6d03bdc8c0a76f818b6db014b2e46070d7d54
parentf8c4470699cbc7d715d29bc7dfc55765f0d7fdf7
TPAC: AutoSuggest throws a JS error on login form

searchbar.tt2 includes a reference to the AutoSuggest widget that
results in an error if the dojo code has not been required, which is
par for the course. However, on the login form we disabled the
AutoSuggest inline code because we didn't want it to override the
autofocus for the login user name; unfortunately, the searchbar exists
on the login form, and a JS error is thrown. On most browsers, not a
problem, but on IE it throws up a nasty dialog if you have the
right/wrong settings.

The simplest way to resolve this is to not set autofocus if we're not on
the basic_search page, but keep the rest of the AutoSuggest code
around.

In addition, we can avoid some other undefined var warnings by stepping
carefully through the search for the dijit value.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/templates/opac/advanced.tt2
Open-ILS/src/templates/opac/parts/js.tt2