JSPAC: Only dojo.require() the autosuggest stuff if we need it
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 26 Jan 2012 15:44:37 +0000 (10:44 -0500)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Thu, 26 Jan 2012 15:44:37 +0000 (10:44 -0500)
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/web/opac/skin/default/js/search_bar.js

index be5e41f..026c183 100644 (file)
@@ -13,8 +13,6 @@ G.evt.common.init.push(searchBarInit);
 var newSearchLocation; 
 var newSearchDepth = null;
 
-dojo.require("openils.widget.AutoSuggest");
-
 function autoSuggestInit() {
     var org_unit_getter = null;
     var global_flag = fieldmapper.standardRequest(
@@ -29,6 +27,8 @@ function autoSuggestInit() {
     else if (global_flag.value && global_flag.value.match(/opac_visible/))
         org_unit_getter = depthSelGetNewLoc;
 
+    dojo.require("openils.widget.AutoSuggest");
+
     /* See comments in openils.AutoSuggestStore, esp. near the constructor,
      * to find out what you can control with the storeArgs object. */
     var widg = new openils.widget.AutoSuggest(