[Commits] r1048 - apps/opengeo/geoexplorer/trunk/lib

commits at geoext.org commits at geoext.org
Thu Jun 11 23:44:18 CEST 2009


Author: tschaub
Date: 2009-06-11 23:44:17 +0200 (Thu, 11 Jun 2009)
New Revision: 1048

Modified:
   apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js
Log:
This is more concisely written with GeoExt.Action.

Modified: apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js
===================================================================
--- apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js	2009-06-11 20:29:16 UTC (rev 1047)
+++ apps/opengeo/geoexplorer/trunk/lib/GeoExplorer.js	2009-06-11 21:44:17 UTC (rev 1048)
@@ -986,46 +986,26 @@
      */
     createTools: function() {
 
-        // create a navigation control
-        var navControl = new OpenLayers.Control.Navigation();
-        this.map.addControl(navControl);        
-        
         // create a navigation history control
         var historyControl = new OpenLayers.Control.NavigationHistory();
-        // create buttons for previous and next
-        var navPreviousButton = new Ext.Button({
+        this.map.addControl(historyControl);
+
+        // create actions for previous and next
+        var navPreviousAction = new GeoExt.Action({
             tooltip: "Zoom to Previous Extent",
+            text: "previous",
             iconCls: "icon-zoom-previous",
             disabled: true,
-            handler: function() {
-                historyControl.previous.trigger();
-            }
+            control: historyControl.previous
         });
-        historyControl.previous.events.on({
-            activate: function() {
-                navPreviousButton.enable();
-            },
-            deactivate: function() {
-                navPreviousButton.disable();
-            }
-        });
-        var navNextButton = new Ext.Button({
+        
+        var navNextAction = new GeoExt.Action({
             tooltip: "Zoom to Next Extent",
+            text: "next",
             iconCls: "icon-zoom-next",
             disabled: true,
-            handler: function() {
-                historyControl.next.trigger();
-            }
+            control: historyControl.next
         });
-        historyControl.next.events.on({
-            activate: function() {
-                navNextButton.enable();
-            },
-            deactivate: function() {
-                navNextButton.disable();
-            }
-        });
-        this.map.addControl(historyControl);
 
         var toolGroup = "toolGroup";
         



More information about the Commits mailing list