remove Control.KeyboardDefaults::destroy method: handler destroy already done in the parent class. r=bartvde (closes #3155)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11678 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Frédéric Junod
2011-03-08 16:31:36 +00:00
parent e3a5426789
commit 2cf798c459
2 changed files with 12 additions and 12 deletions

View File

@@ -38,18 +38,6 @@ OpenLayers.Control.KeyboardDefaults = OpenLayers.Class(OpenLayers.Control, {
* 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.

View File

@@ -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 );