From: Dan Scott Date: Sun, 19 Aug 2012 03:18:33 +0000 (-0400) Subject: Merge branch 'rel_2_3' of git.evergreen-ils.org:Evergreen into rel_2_3_mergery_2 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=30c9a360e74d7f91dd6af58f9ec5f57202fb1902;p=contrib%2FConifer.git Merge branch 'rel_2_3' of git.evergreen-ils.org:Evergreen into rel_2_3_mergery_2 Conflicts: Open-ILS/src/templates/opac/css/style.css.tt2 Open-ILS/src/templates/opac/parts/js.tt2 Signed-off-by: Dan Scott --- 30c9a360e74d7f91dd6af58f9ec5f57202fb1902 diff --cc Open-ILS/src/templates/opac/parts/js.tt2 index e7e0287906,b4a775df99..749419bfe7 --- a/Open-ILS/src/templates/opac/parts/js.tt2 +++ b/Open-ILS/src/templates/opac/parts/js.tt2 @@@ -65,21 -65,17 +65,19 @@@ /* Set focus, and place the cursor at the end of the input string */ dojo.addOnLoad(function() { + /* Don't error out if the object doesn't exist, like on advanced search pages */ + [%- IF basic_search != "f"; %] - dijit.byId('search_box').focus(); - [%- END %] - - var sb_elem = dijit.byId('search_box'); - var sb_value; + if (dojo.byId('search_box')) { + dijit.byId('search_box').focus(); - if (sb_elem) { - sb_value = sb_elem.value; - } - /* Dojo won't trigger a change if the value doesn't change */ - if (sb_value) { - dijit.byId('search_box').setValue(sb_value + ' '); - dijit.byId('search_box').setValue(sb_value); + var sb_value = dijit.byId('search_box').value; + /* Dojo won't trigger a change if the value doesn't change */ + if (sb_value) { + dijit.byId('search_box').setValue(sb_value + ' '); + dijit.byId('search_box').setValue(sb_value); + } } ++ [%- END %] }); [% END; # use_autosuggest %]