[fusion-commits] r2446 - trunk/widgets/Theme

svn_fusion at osgeo.org svn_fusion at osgeo.org
Thu Nov 3 16:03:13 EDT 2011


Author: madair
Date: 2011-11-03 13:03:13 -0700 (Thu, 03 Nov 2011)
New Revision: 2446

Modified:
   trunk/widgets/Theme/thememain.php
Log:
closes #259: adjusting how the Fusion window is retrieved

Modified: trunk/widgets/Theme/thememain.php
===================================================================
--- trunk/widgets/Theme/thememain.php	2011-11-02 17:31:57 UTC (rev 2445)
+++ trunk/widgets/Theme/thememain.php	2011-11-03 20:03:13 UTC (rev 2446)
@@ -358,12 +358,29 @@
                 document.getElementById("busyImg").src = NOT_BUSY_IMAGE;
                 themeReqHandler = null;
 
-                var map = parent.Fusion.getMapByName(mapName);
+                var fWin = GetFusionWindow().Fusion;
+                var map = fWin.getWidgetById('Map');
                 map.reloadMap();
 
             }
         }
 
+        /* locate the Fusion window */
+        function GetFusionWindow() {
+            var curWindow = window;
+            while (!curWindow.Fusion) {
+                if (curWindow.parent && curWindow != curWindow.parent) {
+                    curWindow = curWindow.parent;
+                } else if(curWindow.opener) {
+                    curWindow = curWindow.opener;
+                } else {
+                    alert('Could not find Fusion instance');
+                    break;
+                }
+            }
+            return curWindow;
+        }
+        
         function OnLoad()
         {
             OnLayerChange();



More information about the fusion-commits mailing list