[open-ils-commits] [GIT] Evergreen ILS branch rel_2_3 updated. 4a86ff3c808d6e6845376fdceb3be98c7282bf89

Evergreen Git git at git.evergreen-ils.org
Fri Aug 17 14:15:24 EDT 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_3 has been updated
       via  4a86ff3c808d6e6845376fdceb3be98c7282bf89 (commit)
      from  81f67c7a2af3e12610149b6a77a7c1a28f8e4b98 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4a86ff3c808d6e6845376fdceb3be98c7282bf89
Author: Dan Scott <dscott at laurentian.ca>
Date:   Mon Jul 30 11:30:50 2012 -0400

    TPAC: Autosuggest focus() throws a JS error
    
    On page load, the Dojo autosuggest code tries to set focus to the
    element with the ID "search_box" - which is fine, except when the page
    does not have said ID. Therefore, test for the existence of the ID
    before setting focus to it.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Art Rhyno <art632000 at yahoo.ca>

diff --git a/Open-ILS/src/templates/opac/parts/js.tt2 b/Open-ILS/src/templates/opac/parts/js.tt2
index e4aabb3..b4a775d 100644
--- a/Open-ILS/src/templates/opac/parts/js.tt2
+++ b/Open-ILS/src/templates/opac/parts/js.tt2
@@ -65,13 +65,16 @@
 
     /* Set focus, and place the cursor at the end of the input string */
     dojo.addOnLoad(function() {
-        dijit.byId('search_box').focus();
+        /* Don't error out if the object doesn't exist, like on advanced search pages */
+        if (dojo.byId('search_box')) {
+            dijit.byId('search_box').focus();
 
-        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);
+            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);
+            }
         }
     });
 </script>

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/templates/opac/parts/js.tt2 |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list