Don't let button controls interfer with handlers.

This change involves removal of the map's eventsDiv and introduces an OpenLayers.Events.buttonclick component that adds a buttonclick event which makes sure that only events that are not related to clicking a button propagate. This allows button controls to be on the map's viewPortDiv again.
This commit is contained in:
ahocevar
2012-01-20 03:37:11 +01:00
parent e68acfe91a
commit 05de2b5109
22 changed files with 520 additions and 224 deletions

View File

@@ -513,17 +513,8 @@ OpenLayers.Map = OpenLayers.Class({
this.viewPortDiv.className = "olMapViewport";
this.div.appendChild(this.viewPortDiv);
// the eventsDiv is where we listen for all map events
var eventsDiv = document.createElement("div");
eventsDiv.id = this.id + "_events";
eventsDiv.style.position = "absolute";
eventsDiv.style.width = "100%";
eventsDiv.style.height = "100%";
eventsDiv.style.zIndex = this.Z_INDEX_BASE.Control - 1;
this.viewPortDiv.appendChild(eventsDiv);
this.eventsDiv = eventsDiv;
this.events = new OpenLayers.Events(
this, this.eventsDiv, null, this.fallThrough,
this, this.viewPortDiv, null, this.fallThrough,
{includeXY: true}
);
@@ -534,7 +525,7 @@ OpenLayers.Map = OpenLayers.Class({
this.layerContainerDiv.style.height = '100px';
this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE['Popup']-1;
this.eventsDiv.appendChild(this.layerContainerDiv);
this.viewPortDiv.appendChild(this.layerContainerDiv);
this.updateSize();
if(this.eventListeners instanceof Object) {