fixing error when closing page in IE. Thanks bartvde for the testcase. r=bartvde (closes #3003)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11145 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -68,11 +68,11 @@ OpenLayers.Handler.Box = OpenLayers.Class(OpenLayers.Handler, {
|
|||||||
* Method: destroy
|
* Method: destroy
|
||||||
*/
|
*/
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
|
OpenLayers.Handler.prototype.destroy.apply(this, arguments);
|
||||||
if (this.dragHandler) {
|
if (this.dragHandler) {
|
||||||
this.dragHandler.destroy();
|
this.dragHandler.destroy();
|
||||||
this.dragHandler = null;
|
this.dragHandler = null;
|
||||||
}
|
}
|
||||||
OpenLayers.Handler.prototype.destroy.apply(this, arguments);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
26
tests/Handler/Box.html
Normal file
26
tests/Handler/Box.html
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<script src="../../lib/OpenLayers.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function test_Handler_Box_destroy(t) {
|
||||||
|
t.plan(1);
|
||||||
|
var map = new OpenLayers.Map('map');
|
||||||
|
var control = new OpenLayers.Control();
|
||||||
|
map.addControl(control);
|
||||||
|
var handler = new OpenLayers.Handler.Box(control);
|
||||||
|
handler.activate();
|
||||||
|
try {
|
||||||
|
handler.destroy();
|
||||||
|
t.ok(true, "destroying the box handler should not raise any error");
|
||||||
|
} catch(err) {
|
||||||
|
t.fail("destroying the box handler causes trouble: " + err);
|
||||||
|
}
|
||||||
|
map.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="map" style="width: 300px; height: 150px;"/>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -112,6 +112,7 @@
|
|||||||
<li>Geometry/Rectangle.html</li>
|
<li>Geometry/Rectangle.html</li>
|
||||||
<li>Geometry/Surface.html</li>
|
<li>Geometry/Surface.html</li>
|
||||||
<li>Handler.html</li>
|
<li>Handler.html</li>
|
||||||
|
<li>Handler/Box.html</li>
|
||||||
<li>Handler/Click.html</li>
|
<li>Handler/Click.html</li>
|
||||||
<li>Handler/Drag.html</li>
|
<li>Handler/Drag.html</li>
|
||||||
<li>Handler/Feature.html</li>
|
<li>Handler/Feature.html</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user