Properly destroy OpenLayers.Handler.MouseWheel, patch from fredj. Added

tests for it as well. (Closes #935)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@4100 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-08-29 04:21:17 +00:00
parent cc0f90a5ad
commit 46c5cd6812
2 changed files with 10 additions and 2 deletions

View File

@@ -46,9 +46,8 @@ OpenLayers.Handler.MouseWheel = OpenLayers.Class(OpenLayers.Handler, {
* Method: destroy
*/
destroy: function() {
this.deactivate();
this.wheelListener = null;
OpenLayers.Handler.prototype.destroy.apply(this, arguments);
this.wheelListener = null;
},
/**

View File

@@ -117,6 +117,15 @@
t.ok(deactivated,
"deactivate returns true if the handler was active already");
}
function test_handler_MouseWheel_destroy(t) {
t.plan(1);
var control = new OpenLayers.Control();
var handler = new OpenLayers.Handler.MouseWheel(control);
handler.deactivate = function() {
t.ok(true, "Deactivate called one time.");
}
handler.destroy();
}
</script>