Avoid panel being displayed after deactivate. p=jorix, r=me (closes #2835)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10732 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2010-09-13 13:26:07 +00:00
parent 35092e9226
commit a1f20ee345
2 changed files with 22 additions and 1 deletions

View File

@@ -227,7 +227,26 @@
t.ok(!controlNoDeactive.active, "Tool control autoActivate:true is not active");
}
function test_Control_Panel_dectivate (t) {
t.plan(3);
var map = new OpenLayers.Map('map');
var control = new OpenLayers.Control();
var panel = new OpenLayers.Control.Panel();
map.addControl(panel);
panel.addControls([control]);
t.ok(panel.div.innerHTML != "", "Panel displayed after activate");
panel.deactivate();
t.ok(panel.div.innerHTML == "",
"Panel is not displayed after deactivate without any active control");
panel.activate();
var div = panel.div;
panel.destroy();
t.ok(panel.div.innerHTML == "",
"Panel is not displayed after destroy without any active control");
map.destroy();
}
</script>
</head>
<body>