lp1090867 Hide Fields undefined var error
authorJason Etheridge <jason@esilibrary.com>
Fri, 21 Dec 2012 12:26:36 +0000 (07:26 -0500)
committerBen Shum <bshum@biblio.org>
Fri, 21 Dec 2012 15:06:01 +0000 (10:06 -0500)
This fixes the "Error in widget_prompt.js, my_init(): TypeError: offlineStrings
is undefined" error.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/xul/staff_client/chrome/content/util/widget_prompt.js

index ff128ca..3bb78a4 100644 (file)
@@ -13,6 +13,10 @@ function my_init() {
             $('widget_prompt_main').appendChild(widget);
         }
 
+        if (typeof offlineStrings == 'undefined') {
+            offlineStrings = $('offlineStrings');
+        }
+
         var ok_label = xul_param('ok_label') || offlineStrings.getString('common.ok.label');
         $('ok_btn').setAttribute('label',ok_label);