Preserve the title and the className if they are set in createControlMarkup.

This commit is contained in:
Xavier Mamano
2012-02-18 17:51:36 +01:00
committed by Éric Lemoine
parent 3b7585be24
commit 9e48825205

View File

@@ -249,8 +249,10 @@ OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, {
for (var i=0, len=controls.length; i<len; i++) {
var control = controls[i],
element = this.createControlMarkup(control);
element.className = control.displayClass + "ItemInactive olButton";
if (control.title != "") {
OpenLayers.Element.addClass(element,
control.displayClass + "ItemInactive");
OpenLayers.Element.addClass(element, "olButton");
if (control.title != "" && !element.title) {
element.title = control.title;
}
control.panel_div = element;