[Commits] r1053 - apps/opengeo/geoexplorer/branches/0.1.x/lib

commits at geoext.org commits at geoext.org
Fri Jun 12 00:09:49 CEST 2009


Author: tschaub
Date: 2009-06-12 00:09:49 +0200 (Fri, 12 Jun 2009)
New Revision: 1053

Modified:
   apps/opengeo/geoexplorer/branches/0.1.x/lib/GeoExplorer.js
Log:
When enabling the toolbar, disable those items that were specifically disabled in their config.

Modified: apps/opengeo/geoexplorer/branches/0.1.x/lib/GeoExplorer.js
===================================================================
--- apps/opengeo/geoexplorer/branches/0.1.x/lib/GeoExplorer.js	2009-06-11 21:59:28 UTC (rev 1052)
+++ apps/opengeo/geoexplorer/branches/0.1.x/lib/GeoExplorer.js	2009-06-11 22:09:49 UTC (rev 1053)
@@ -336,7 +336,16 @@
             disabled: true,
             items: this.createTools()
         });
-        this.on("ready", function() {toolbar.enable();});
+        this.on("ready", function() {
+            // enable only those items that were not specifically disabled
+            var disabled = toolbar.items.filterBy(function(item) {
+                return item.initialConfig && item.initialConfig.disabled;
+            });
+            toolbar.enable();
+            disabled.each(function(item) {
+                item.disable();
+            });
+        });
 
         var viewport = new Ext.Viewport({
             layout: "fit",



More information about the Commits mailing list