[fusion-commits] r2048 - trunk/widgets

svn_fusion at osgeo.org svn_fusion at osgeo.org
Sun Jan 31 21:21:36 EST 2010


Author: liuar
Date: 2010-01-31 21:21:35 -0500 (Sun, 31 Jan 2010)
New Revision: 2048

Modified:
   trunk/widgets/LinkToView.js
Log:
Fix ticket #357 LinkToView cannot be displayed on Statusbar

Analysis?\239?\188?\154
In revision 1733, this.domObj.appendChild(this.anchor) was removed from the initializeWidget function and added to the setUiObj function. if the LinkToView? widget is added to StatusBar, it will not be assigned any uiClass, so the setUiObj function will never be called. That's why the widget can not be displayed on StatusBar.

Resolution:
If the widget has domObj at initialize time, we just append it to the domObj, else wait until setUiObj is called. 


Modified: trunk/widgets/LinkToView.js
===================================================================
--- trunk/widgets/LinkToView.js	2010-01-28 21:08:05 UTC (rev 2047)
+++ trunk/widgets/LinkToView.js	2010-02-01 02:21:35 UTC (rev 2048)
@@ -56,7 +56,7 @@
             join = '&';
           }
         }
-        this.anchorLabel = json.Label ? json.Label[0] : (this.domObj ? this.domObj.innerHTML : 'Link to View');
+        this.anchorLabel = json.Label ? json.Label[0] : (this.domObj ? (this.domObj.innerHTML ? this.domObj.innerHTML : 'Link to View') : 'Link to View');
 
         Fusion.addWidgetStyleSheet(widgetTag.location + 'LinkToView/LinkToView.css');
         this.anchor = document.createElement('a');
@@ -65,6 +65,11 @@
         this.anchor.innerHTML = this.anchorLabel;
         this.anchor.title = json.Tooltip ? json.Tooltip[0] : 'Right-click to copy or bookmark link to current view';
         
+        if(this.domObj){
+            this.domObj.innerHTML = '';
+            this.domObj.appendChild(this.anchor);
+        }
+        
         this.getMap().oMapOL.events.register("addlayer", this, this.setListener);
         this.enable();                   
     },



More information about the fusion-commits mailing list