TPAC: AutoSuggest throws a JS error on login form user/dbs/no_autosuggest_complainies
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:02:39 +0000 (16:02 -0400)
commitb80f2acdadfb5ffb2006a304681c33eaccc514b1
tree41a9a34487d69a0dcff55dd9c8e80edd3c242582
parent6c275daf6f4d669eec14fe1226902ab12066ce95
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