LP 1155611 - prevent unnecessary load of fm_IDL.xml
authorBill Erickson <berick@esilibrary.com>
Fri, 15 Mar 2013 13:24:45 +0000 (09:24 -0400)
committerMike Rylander <mrylander@gmail.com>
Fri, 15 Mar 2013 15:31:53 +0000 (11:31 -0400)
Ensure fm_IDL.xml is loaded only when IDL2js has not been loaded.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/web/js/dojo/fieldmapper/IDL.js

index 8ccdca5..46f0241 100644 (file)
@@ -31,7 +31,10 @@ if(!dojo._hasResource["fieldmapper.IDL"]) {
                 window._preload_fieldmapper_IDL = null;
             }
 
-            if(!fieldmapper.IDL.fmclasses || !fieldmapper.IDL.fmclasses.length || (classlist && classlist.length)) {
+            if(!fieldmapper.IDL.fmclasses || 
+                    !Object.keys(fieldmapper.IDL.fmclasses).length || 
+                    (classlist && classlist.length)) {
+
                 var idl_url = this._URL_PATH;
 
                 if (classlist.length && (classlist.length > 1 || classlist[0] != '*')) {