No additional events registered on the LayerSwitcher.

With the buttonclick event, we can also handle clicks on layer names and checkboxes/radiobuttons when they get the olButton class. To make this work on iOS, we have to add a check in buttonclick.js to handle the case where the event occurred on a text element (nodeType === 3).
This commit is contained in:
ahocevar
2012-02-02 00:02:51 +01:00
parent 742ada16bf
commit a278986442
2 changed files with 26 additions and 69 deletions
+1 -1
View File
@@ -108,7 +108,7 @@ OpenLayers.Events.buttonclick = OpenLayers.Class({
var propagate = true,
element = OpenLayers.Event.element(evt);
if (element && (OpenLayers.Event.isLeftClick(evt) || !~evt.type.indexOf("mouse"))) {
if (OpenLayers.Element.hasClass(element, "olAlphaImg")) {
if (element.nodeType === 3 || OpenLayers.Element.hasClass(element, "olAlphaImg")) {
element = element.parentNode;
}
if (OpenLayers.Element.hasClass(element, "olButton")) {