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 (!this.active) { return false; }
|
||||||
if (control.type == OpenLayers.Control.TYPE_BUTTON) {
|
if (control.type == OpenLayers.Control.TYPE_BUTTON) {
|
||||||
control.trigger();
|
control.trigger();
|
||||||
|
this.redraw();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (control.type == OpenLayers.Control.TYPE_TOGGLE) {
|
if (control.type == OpenLayers.Control.TYPE_TOGGLE) {
|
||||||
@@ -145,6 +146,7 @@ OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
} else {
|
} else {
|
||||||
control.activate();
|
control.activate();
|
||||||
}
|
}
|
||||||
|
this.redraw();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (var i = 0; i < this.controls.length; i++) {
|
for (var i = 0; i < this.controls.length; i++) {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
t.eq( control.displayClass, "olControlPanel", "displayClass is correct" );
|
t.eq( control.displayClass, "olControlPanel", "displayClass is correct" );
|
||||||
}
|
}
|
||||||
function test_Control_Panel_constructor (t) {
|
function test_Control_Panel_constructor (t) {
|
||||||
t.plan(5);
|
t.plan(6);
|
||||||
var map = new OpenLayers.Map('map');
|
var map = new OpenLayers.Map('map');
|
||||||
var panel = new OpenLayers.Control.Panel();
|
var panel = new OpenLayers.Control.Panel();
|
||||||
var toolControl = new OpenLayers.Control.ZoomBox();
|
var toolControl = new OpenLayers.Control.ZoomBox();
|
||||||
@@ -38,6 +38,10 @@
|
|||||||
t.ok(toolControl.active && !anotherToolControl.active && !toggleControl.active,
|
t.ok(toolControl.active && !anotherToolControl.active && !toggleControl.active,
|
||||||
"activated one tool control, the other one is inactive and the toggle control also.");
|
"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);
|
panel.activateControl(toggleControl);
|
||||||
t.ok(toolControl.active && !anotherToolControl.active && toggleControl.active,
|
t.ok(toolControl.active && !anotherToolControl.active && toggleControl.active,
|
||||||
"activated the toggle control, which has no influence on the tool controls.");
|
"activated the toggle control, which has no influence on the tool controls.");
|
||||||
|
|||||||
Reference in New Issue
Block a user