Merge branch 'rel_2_3' of git.evergreen-ils.org:Evergreen into rel_2_3_mergery_2
authorDan Scott <dscott@laurentian.ca>
Sun, 19 Aug 2012 03:18:33 +0000 (23:18 -0400)
committerDan Scott <dscott@laurentian.ca>
Sun, 19 Aug 2012 03:18:33 +0000 (23:18 -0400)
Conflicts:
Open-ILS/src/templates/opac/css/style.css.tt2
Open-ILS/src/templates/opac/parts/js.tt2

Signed-off-by: Dan Scott <dscott@laurentian.ca>
1  2 
Open-ILS/src/templates/opac/css/style.css.tt2
Open-ILS/src/templates/opac/parts/config.tt2
Open-ILS/src/templates/opac/parts/js.tt2
Open-ILS/src/templates/opac/parts/searchbar.tt2

  
      /* Set focus, and place the cursor at the end of the input string */
      dojo.addOnLoad(function() {
-         dijit.byId('search_box').focus();
-         [%- END %]
-         var sb_elem = dijit.byId('search_box');
-         var sb_value;
+         /* Don't error out if the object doesn't exist, like on advanced search pages */
 +        [%- IF basic_search != "f"; %]
+         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 %]
      });
  </script>
  [% END; # use_autosuggest %]