[OpenLayers-Commits] r11678 - in trunk/openlayers: lib/OpenLayers/Control tests/Control

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Tue Mar 8 11:31:38 EST 2011


Author: fredj
Date: 2011-03-08 08:31:36 -0800 (Tue, 08 Mar 2011)
New Revision: 11678

Modified:
   trunk/openlayers/lib/OpenLayers/Control/KeyboardDefaults.js
   trunk/openlayers/tests/Control/KeyboardDefaults.html
Log:
remove Control.KeyboardDefaults::destroy method: handler destroy already done in the parent class. r=bartvde (closes #3155)

Modified: trunk/openlayers/lib/OpenLayers/Control/KeyboardDefaults.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Control/KeyboardDefaults.js	2011-03-08 16:19:36 UTC (rev 11677)
+++ trunk/openlayers/lib/OpenLayers/Control/KeyboardDefaults.js	2011-03-08 16:31:36 UTC (rev 11678)
@@ -37,19 +37,7 @@
     /**
      * Constructor: OpenLayers.Control.KeyboardDefaults
      */
-    
-    /**
-     * APIMethod: destroy
-     */
-    destroy: function() {
-        if (this.handler) {
-            this.handler.destroy();
-        }        
-        this.handler = null;
         
-        OpenLayers.Control.prototype.destroy.apply(this, arguments);
-    },
-    
     /**
      * Method: draw
      * Create handler.

Modified: trunk/openlayers/tests/Control/KeyboardDefaults.html
===================================================================
--- trunk/openlayers/tests/Control/KeyboardDefaults.html	2011-03-08 16:19:36 UTC (rev 11677)
+++ trunk/openlayers/tests/Control/KeyboardDefaults.html	2011-03-08 16:31:36 UTC (rev 11678)
@@ -12,6 +12,18 @@
         t.eq( control.displayClass,  "olControlKeyboardDefaults", "displayClass is correct" );
     }
 
+    function test_Control_KeyboardDefaults_destroy (t) {
+        t.plan(2);
+    
+        map = new OpenLayers.Map('map');
+        var control = new OpenLayers.Control.KeyboardDefaults();
+        map.addControl(control);
+        t.ok(control.handler != null, "control.handler is created");
+        control.destroy();
+        t.ok(control.handler == null, "control.handler is null after destroy");
+        map.destroy();
+    }
+
     function test_Control_KeyboardDefaults_addControl (t) {
         t.plan( 4 );
 



More information about the Commits mailing list