[Commits] r403 - apps/opengeo/geoexplorer/trunk/lib
commits at geoext.org
commits at geoext.org
Thu Apr 16 23:50:05 CEST 2009
Author: tschaub
Date: 2009-04-16 23:50:04 +0200 (Thu, 16 Apr 2009)
New Revision: 403
Modified:
apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js
Log:
Initialize the cap grid just before it is shown and don't enable the button that shows until the app is ready.
Modified: apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js
===================================================================
--- apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js 2009-04-16 17:07:33 UTC (rev 402)
+++ apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js 2009-04-16 21:50:04 UTC (rev 403)
@@ -151,6 +151,15 @@
this.createMapOverlay()
]
});
+
+ var addLayerButton = new Ext.Button({
+ text : "Add Layers",
+ disabled: true,
+ iconCls: "icon-addlayers",
+ handler : this.showCapabilitiesGrid,
+ scope: this
+ });
+ this.on("ready", function() {addLayerButton.enable()});
var layersContainer = new Ext.Panel({
autoScroll: true,
@@ -194,12 +203,7 @@
}
})
}],
- tbar: [new Ext.Button({
- text : "Add Layers",
- iconCls: "icon-addlayers",
- handler : this.showCapabilitiesGrid,
- scope: this
- })]
+ tbar: [addLayerButton]
});
var legendContainer = new GeoExt.LegendPanel({
@@ -250,7 +254,6 @@
}
});
- this.initCapGrid();
},
@@ -357,7 +360,10 @@
* Method: showCapabilitiesGrid
* Shows the window with a capabilities grid.
*/
- showCapabilitiesGrid: function(){
+ showCapabilitiesGrid: function() {
+ if(!this.capGrid) {
+ this.initCapGrid();
+ }
this.capGrid.show();
},
More information about the Commits
mailing list