[mapguide-commits] r6437 - in sandbox/adsk/2.4j/Oem/fusionMG/templates/mapguide: aqua limegold maroon slate turquoiseyellow

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Jan 17 21:06:30 EST 2012


Author: hubu
Date: 2012-01-17 18:06:30 -0800 (Tue, 17 Jan 2012)
New Revision: 6437

Modified:
   sandbox/adsk/2.4j/Oem/fusionMG/templates/mapguide/aqua/index.html
   sandbox/adsk/2.4j/Oem/fusionMG/templates/mapguide/limegold/index.html
   sandbox/adsk/2.4j/Oem/fusionMG/templates/mapguide/maroon/index.html
   sandbox/adsk/2.4j/Oem/fusionMG/templates/mapguide/slate/index.html
   sandbox/adsk/2.4j/Oem/fusionMG/templates/mapguide/turquoiseyellow/index.html
Log:
on behalf of libr (Bruce li)

Reason:
There are many handlers for the Event - MAP_LOADED of Map, one of them deregister itself after executed while other handlers have not executed, this action disturb the sequence of the execution of handlers behind.

solution:
Remove the code of deregistering Eventhandler. take another way to disable the Eventhandler.

Modified: sandbox/adsk/2.4j/Oem/fusionMG/templates/mapguide/aqua/index.html
===================================================================
--- sandbox/adsk/2.4j/Oem/fusionMG/templates/mapguide/aqua/index.html	2012-01-18 01:12:24 UTC (rev 6436)
+++ sandbox/adsk/2.4j/Oem/fusionMG/templates/mapguide/aqua/index.html	2012-01-18 02:06:30 UTC (rev 6437)
@@ -177,14 +177,13 @@
     mapWidget.registerForEvent(Fusion.Event.MAP_LOADED, initPanelHandler);
 }
 
+var isTaskPaneRegistered = false;
+
 var initPanelHandler = function() {
+    if(isTaskPaneRegistered) return;
     //register this with MAP_LOADED so that the initial layout will remain
     Fusion.registerForEvent(Fusion.Event.TASK_PANE_LOADED, showTaskPane);
-
-    // The initPanelHandler is used to register task pane, which only needs once.
-    // So we should remove the register to avoid initPanelHandler to be called multiple times.
-    var mapWidget = Fusion.getMapById('Map');
-    mapWidget.deregisterForEvent(Fusion.Event.MAP_LOADED, initPanelHandler);
+    isTaskPaneRegistered = true;
 }
 
 var showOverviewMap = function() {

Modified: sandbox/adsk/2.4j/Oem/fusionMG/templates/mapguide/limegold/index.html
===================================================================
--- sandbox/adsk/2.4j/Oem/fusionMG/templates/mapguide/limegold/index.html	2012-01-18 01:12:24 UTC (rev 6436)
+++ sandbox/adsk/2.4j/Oem/fusionMG/templates/mapguide/limegold/index.html	2012-01-18 02:06:30 UTC (rev 6437)
@@ -164,14 +164,13 @@
     mapWidget.registerForEvent(Fusion.Event.MAP_LOADED, initPanelHandler);
 }
 
+var isTaskPaneRegistered = false;
+
 var initPanelHandler = function() {
+    if(isTaskPaneRegistered) return;
     //register this with MAP_LOADED so that the initial layout will remain
     Fusion.registerForEvent(Fusion.Event.TASK_PANE_LOADED, showTaskPane);
-
-    // The initPanelHandler is used to register task pane, which only needs once.
-    // So we should remove the register to avoid initPanelHandler to be called multiple times.
-    var mapWidget = Fusion.getMapById('Map');
-    mapWidget.deregisterForEvent(Fusion.Event.MAP_LOADED, initPanelHandler);
+    isTaskPaneRegistered = true;
 }
 
 var showOverviewMap = function() {

Modified: sandbox/adsk/2.4j/Oem/fusionMG/templates/mapguide/maroon/index.html
===================================================================
--- sandbox/adsk/2.4j/Oem/fusionMG/templates/mapguide/maroon/index.html	2012-01-18 01:12:24 UTC (rev 6436)
+++ sandbox/adsk/2.4j/Oem/fusionMG/templates/mapguide/maroon/index.html	2012-01-18 02:06:30 UTC (rev 6437)
@@ -186,14 +186,13 @@
     mapWidget.registerForEvent(Fusion.Event.MAP_LOADED, initPanelHandler);
 }
 
+var isTaskPaneRegistered = false;
+
 var initPanelHandler = function() {
+    if(isTaskPaneRegistered) return;
     //register this with MAP_LOADED so that the initial layout will remain
     Fusion.registerForEvent(Fusion.Event.TASK_PANE_LOADED, showTaskPane);
-
-    // The initPanelHandler is used to register task pane, which only needs once.
-    // So we should remove the register to avoid initPanelHandler to be called multiple times.
-    var mapWidget = Fusion.getMapById('Map');
-    mapWidget.deregisterForEvent(Fusion.Event.MAP_LOADED, initPanelHandler);
+    isTaskPaneRegistered = true;
 }
 
 var showOverviewMap = function() {

Modified: sandbox/adsk/2.4j/Oem/fusionMG/templates/mapguide/slate/index.html
===================================================================
--- sandbox/adsk/2.4j/Oem/fusionMG/templates/mapguide/slate/index.html	2012-01-18 01:12:24 UTC (rev 6436)
+++ sandbox/adsk/2.4j/Oem/fusionMG/templates/mapguide/slate/index.html	2012-01-18 02:06:30 UTC (rev 6437)
@@ -167,14 +167,13 @@
     mapWidget.registerForEvent(Fusion.Event.MAP_LOADED, initPanelHandler);
 }
 
+var isTaskPaneRegistered = false;
+
 var initPanelHandler = function() {
+    if(isTaskPaneRegistered) return;
     //register this with MAP_LOADED so that the initial layout will remain
     Fusion.registerForEvent(Fusion.Event.TASK_PANE_LOADED, showTaskPane);
-
-    // The initPanelHandler is used to register task pane, which only needs once.
-    // So we should remove the register to avoid initPanelHandler to be called multiple times.
-    var mapWidget = Fusion.getMapById('Map');
-    mapWidget.deregisterForEvent(Fusion.Event.MAP_LOADED, initPanelHandler);
+    isTaskPaneRegistered = true;
 }
 
 var showOverviewMap = function() {

Modified: sandbox/adsk/2.4j/Oem/fusionMG/templates/mapguide/turquoiseyellow/index.html
===================================================================
--- sandbox/adsk/2.4j/Oem/fusionMG/templates/mapguide/turquoiseyellow/index.html	2012-01-18 01:12:24 UTC (rev 6436)
+++ sandbox/adsk/2.4j/Oem/fusionMG/templates/mapguide/turquoiseyellow/index.html	2012-01-18 02:06:30 UTC (rev 6437)
@@ -152,14 +152,13 @@
     mapWidget.registerForEvent(Fusion.Event.MAP_LOADED, initPanelHandler);
 }
 
+var isTaskPaneRegistered = false;
+
 var initPanelHandler = function() {
+    if(isTaskPaneRegistered) return;
     //register this with MAP_LOADED so that the initial layout will remain
     Fusion.registerForEvent(Fusion.Event.TASK_PANE_LOADED, showTaskPane);
-
-    // The initPanelHandler is used to register task pane, which only needs once.
-    // So we should remove the register to avoid initPanelHandler to be called multiple times.
-    var mapWidget = Fusion.getMapById('Map');
-    mapWidget.deregisterForEvent(Fusion.Event.MAP_LOADED, initPanelHandler);
+    isTaskPaneRegistered = true;
 }
 
 var showOverviewMap = function() {



More information about the mapguide-commits mailing list