[fusion-commits] r2047 - sandbox/jxlib-3.0/widgets

svn_fusion at osgeo.org svn_fusion at osgeo.org
Thu Jan 28 16:08:06 EST 2010


Author: madair
Date: 2010-01-28 16:08:05 -0500 (Thu, 28 Jan 2010)
New Revision: 2047

Modified:
   sandbox/jxlib-3.0/widgets/AddWMSLayer.js
Log:
change AddWMSLayer from button to just drawing in it's DOM obj

Modified: sandbox/jxlib-3.0/widgets/AddWMSLayer.js
===================================================================
--- sandbox/jxlib-3.0/widgets/AddWMSLayer.js	2010-01-28 19:13:58 UTC (rev 2046)
+++ sandbox/jxlib-3.0/widgets/AddWMSLayer.js	2010-01-28 21:08:05 UTC (rev 2047)
@@ -32,50 +32,30 @@
  * **********************************************************************/
 
 Fusion.Widget.AddWMSLayer = OpenLayers.Class(Fusion.Widget, {
-    uiClass: Jx.Button,
+    
     initializeWidget: function(widgetTag) {
         var json = widgetTag.extension;
         
-        this.button = document.getElementById('AddWMSLayer');
-        this.button.addEvent('click', OpenLayers.Function.bind(this.activate, this));
-        
         this.serviceURL = json.ServiceURL ? json.ServiceURL[0] : '';
         
         this.dialogContentURL = Fusion.getFusionURL() + widgetTag.location + 'AddWMSLayer/AddWMSLayer.html';
         this.addWMSLayerURL = widgetTag.location + 'AddWMSLayer/AddWMSLayer.php';
         Fusion.addWidgetStyleSheet(widgetTag.location + 'AddWMSLayer/AddWMSLayer.css');
+        var onload = OpenLayers.Function.bind(this.contentLoaded, this);
+        this.domObj.set('load', {onComplete: onload});
+        this.domObj.load(this.dialogContentURL);
     },
     
-    /**
-     * load an interface that list the layers available from a WMS server 
-     */
-    activate: function() {
-        if (!this.dialog) {
-            this.dialog = new Jx.Dialog(
-                {
-                    label: 'Add WMS Layer',
-                    modal: false,
-                    contentURL: this.dialogContentURL,
-                    width: 415,
-                    height: 420,
-                    resizeable: true,
-                    onContentLoaded: OpenLayers.Function.bind(this.contentLoaded, this)
-                }
-            );
-        }
-        this.dialog.show();
-    },
-    
-    contentLoaded: function(dialog) {
-        this.outputDiv = dialog.domObj.getElementById('AddWMSLayersContent');
-        this.urlInput = dialog.domObj.getElementById('wmsServerName');
+    contentLoaded: function() {
+        this.outputDiv = this.domObj.getElementById('AddWMSLayersContent');
+        this.urlInput = this.domObj.getElementById('wmsServerName');
         if (this.serviceURL != '') {
           this.urlInput.value = this.serviceURL;
         }
         var listButton = new Jx.Button({
             label: 'List Layers',
             onClick: OpenLayers.Function.bind(this.initializeWMS, this)
-        }).addTo(dialog.domObj.getElementById('listLayersButton'));
+        }).addTo(this.domObj.getElementById('listLayersButton'));
     },
     
     initializeWMS: function() {



More information about the fusion-commits mailing list