partially reverted r10732 (because we don't deactivate controls on destrly) and reverted r10810 (because it is not needed any more). r=elemoine (closes #2864)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10834 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -343,10 +343,7 @@ OpenLayers.Control = OpenLayers.Class({
|
|||||||
this.displayClass.replace(/ /g, "") + "Active"
|
this.displayClass.replace(/ /g, "") + "Active"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// deal with the case where the control is destroyed
|
this.events.triggerEvent("deactivate");
|
||||||
if(this.events) {
|
|
||||||
this.events.triggerEvent("deactivate");
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -95,7 +95,6 @@ OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
* APIMethod: destroy
|
* APIMethod: destroy
|
||||||
*/
|
*/
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
this.deactivate();
|
|
||||||
OpenLayers.Control.prototype.destroy.apply(this, arguments);
|
OpenLayers.Control.prototype.destroy.apply(this, arguments);
|
||||||
for(var i = this.controls.length - 1 ; i >= 0; i--) {
|
for(var i = this.controls.length - 1 ; i >= 0; i--) {
|
||||||
if(this.controls[i].events) {
|
if(this.controls[i].events) {
|
||||||
|
|||||||
@@ -227,8 +227,8 @@
|
|||||||
t.ok(!controlNoDeactive.active, "Tool control autoActivate:true is not active");
|
t.ok(!controlNoDeactive.active, "Tool control autoActivate:true is not active");
|
||||||
|
|
||||||
}
|
}
|
||||||
function test_Control_Panel_dectivate (t) {
|
function test_Control_Panel_deactivate (t) {
|
||||||
t.plan(3);
|
t.plan(2);
|
||||||
var map = new OpenLayers.Map('map');
|
var map = new OpenLayers.Map('map');
|
||||||
var control = new OpenLayers.Control();
|
var control = new OpenLayers.Control();
|
||||||
var panel = new OpenLayers.Control.Panel();
|
var panel = new OpenLayers.Control.Panel();
|
||||||
@@ -240,11 +240,6 @@
|
|||||||
t.ok(panel.div.innerHTML == "",
|
t.ok(panel.div.innerHTML == "",
|
||||||
"Panel is not displayed after deactivate without any active control");
|
"Panel is not displayed after deactivate without any active control");
|
||||||
|
|
||||||
panel.activate();
|
|
||||||
var div = panel.div;
|
|
||||||
panel.destroy();
|
|
||||||
t.eq(panel.div, null,
|
|
||||||
"Panel is not displayed after destroy without any active control");
|
|
||||||
map.destroy();
|
map.destroy();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user