Redraw control.panel when toggle controls are activated. Patch by
sbenthall (yay), r=me, (Closes #895) git-svn-id: http://svn.openlayers.org/trunk/openlayers@7597 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -137,6 +137,7 @@ OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, {
|
||||
if (!this.active) { return false; }
|
||||
if (control.type == OpenLayers.Control.TYPE_BUTTON) {
|
||||
control.trigger();
|
||||
this.redraw();
|
||||
return;
|
||||
}
|
||||
if (control.type == OpenLayers.Control.TYPE_TOGGLE) {
|
||||
@@ -145,6 +146,7 @@ OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, {
|
||||
} else {
|
||||
control.activate();
|
||||
}
|
||||
this.redraw();
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < this.controls.length; i++) {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
t.eq( control.displayClass, "olControlPanel", "displayClass is correct" );
|
||||
}
|
||||
function test_Control_Panel_constructor (t) {
|
||||
t.plan(5);
|
||||
t.plan(6);
|
||||
var map = new OpenLayers.Map('map');
|
||||
var panel = new OpenLayers.Control.Panel();
|
||||
var toolControl = new OpenLayers.Control.ZoomBox();
|
||||
@@ -37,6 +37,10 @@
|
||||
panel.activateControl(toolControl);
|
||||
t.ok(toolControl.active && !anotherToolControl.active && !toggleControl.active,
|
||||
"activated one tool control, the other one is inactive and the toggle control also.");
|
||||
|
||||
panel.redraw = function(){
|
||||
t.ok(true,"Redraw called on activated toggle");
|
||||
}
|
||||
|
||||
panel.activateControl(toggleControl);
|
||||
t.ok(toolControl.active && !anotherToolControl.active && toggleControl.active,
|
||||
|
||||
Reference in New Issue
Block a user