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:
@@ -38,18 +38,6 @@ OpenLayers.Control.KeyboardDefaults = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
* Constructor: OpenLayers.Control.KeyboardDefaults
|
* 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
|
* Method: draw
|
||||||
* Create handler.
|
* Create handler.
|
||||||
|
|||||||
@@ -12,6 +12,18 @@
|
|||||||
t.eq( control.displayClass, "olControlKeyboardDefaults", "displayClass is correct" );
|
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) {
|
function test_Control_KeyboardDefaults_addControl (t) {
|
||||||
t.plan( 4 );
|
t.plan( 4 );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user