[fusion-commits] r1681 - trunk/lib

svn_fusion at osgeo.org svn_fusion at osgeo.org
Mon Nov 24 15:53:59 EST 2008


Author: madair
Date: 2008-11-24 15:53:58 -0500 (Mon, 24 Nov 2008)
New Revision: 1681

Modified:
   trunk/lib/ApplicationDefinition.js
   trunk/lib/fusion.js
Log:
closes #155: also break execution thread if session parameter is supplied

Modified: trunk/lib/ApplicationDefinition.js
===================================================================
--- trunk/lib/ApplicationDefinition.js	2008-11-20 20:25:23 UTC (rev 1680)
+++ trunk/lib/ApplicationDefinition.js	2008-11-24 20:53:58 UTC (rev 1681)
@@ -123,10 +123,14 @@
                               OpenLayers.Function.bind(this.getAppDefCB, this));
             }
         } else {
+          //these need to be called via setTimeout so that the execution thread
+          //is broken in IE and so that the ApplicationDefinition constructor
+          //will return a valid object to Fusion in loadConfig before the loadState
+          //gets incremented.
             if (!this.sessionId) {
-              window.setTimeout(OpenLayers.Function.bind(this.delayedDispatch,this),50);
+              window.setTimeout(OpenLayers.Function.bind(this.delayedDispatch,this),5);
             } else {
-              this.getAppDef();
+              window.setTimeout(OpenLayers.Function.bind(this.getAppDef,this),5);
             }
         }
         return true;

Modified: trunk/lib/fusion.js
===================================================================
--- trunk/lib/fusion.js	2008-11-20 20:25:23 UTC (rev 1680)
+++ trunk/lib/fusion.js	2008-11-24 20:53:58 UTC (rev 1681)
@@ -320,8 +320,13 @@
                     break;
                 case this.LOAD_COMPLETE:
                     //console.log('load complete');
-                    this.applicationDefinition.create();
-                    this.triggerEvent(Fusion.Event.FUSION_INITIALIZED);
+                    if (this.applicationDefinition) {
+                      this.applicationDefinition.create();
+                      this.triggerEvent(Fusion.Event.FUSION_INITIALIZED);
+                    } else {
+                      Fusion.reportError(new Fusion.Error(Fusion.Error.FATAL, 
+                                          'failed to create AppDef object'));
+                    }
                     break;
             }
         },
@@ -338,7 +343,7 @@
             //with the compressed version, all scripts are already laoded so just 
             //increment the load state
             if (this.aScripts.length == 0) {
-                this.setLoadState(this.loadState+1);
+                this.setLoadState(this.LOAD_COMPLETE);
                 return;
             }
 
@@ -426,7 +431,7 @@
                 if (this.aScripts.length > 0) {
                     this.loadQueuedScripts();
                 } else {
-                    this.setLoadState(this.loadState+1);
+                    this.setLoadState(this.LOAD_COMPLETE);
                 }
             }
         },



More information about the fusion-commits mailing list