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

commits at geoext.org commits at geoext.org
Thu Apr 16 18:09:54 CEST 2009


Author: dwins
Date: 2009-04-16 18:09:54 +0200 (Thu, 16 Apr 2009)
New Revision: 401

Modified:
   apps/opengeo/geoexplorer/trunk/lib/MapToolSplitToggle.js
Log:
Have MapToolSplitToggle respect allowDepress config option


Modified: apps/opengeo/geoexplorer/trunk/lib/MapToolSplitToggle.js
===================================================================
--- apps/opengeo/geoexplorer/trunk/lib/MapToolSplitToggle.js	2009-04-16 06:32:40 UTC (rev 400)
+++ apps/opengeo/geoexplorer/trunk/lib/MapToolSplitToggle.js	2009-04-16 16:09:54 UTC (rev 401)
@@ -58,8 +58,12 @@
     MapToolSplitToggle.superclass.constructor.call(this, options);
 
     if (options.toggleGroup) {
-        this.on("render", function() {Ext.ButtonToggleMgr.register(this);}, this);
+        this.on("render", 
+            function() {Ext.ButtonToggleMgr.register(this);},
+            this
+        );
     }
+
 };
 
 Ext.extend(MapToolSplitToggle, Ext.SplitButton, {
@@ -74,6 +78,33 @@
      * {Array} the OpenLayers tools from this component's configuration.
      */
     tools: null,
+
+    onClick: function (e) {
+        e.preventDefault();
+        if (!this.disabled) {
+            if (e.getTarget(".x-btn-menu-arrow-wrap")) {
+                if (this.menu 
+                    && !this.menu.isVisible() 
+                    && !this.ignoreNextClick) { 
+                    this.showMenu();
+                }
+                this.fireEvent("arrowclick", this, e);
+                if (this.arrowHandler) {
+                    this.arrowHandler.call(this.scope || this, this, e);
+                }
+            } else {
+                if (this.enableToggle 
+                    && (this.allowDepress !== false 
+                    || !this.pressed)) {
+                    this.toggle();
+                }
+                this.fireEvent("click", this, e);
+                if (this.handler) {
+                    this.handler.call(this.scope || this, this, e);
+                }
+            }
+        }
+    },
     
     /**
      * Method: handleEvent



More information about the Commits mailing list