fix for #457 - allow specification of whether or not to let events fallthrough the map

git-svn-id: http://svn.openlayers.org/trunk/openlayers@2863 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2007-03-22 21:06:29 +00:00
parent f66441779c
commit 803e8b9dbd

View File

@@ -127,6 +127,15 @@ OpenLayers.Map.prototype = {
/** @type string */
theme: null,
/** Should OpenLayers allow events on the map to fall through to other
* elements on the page, or should it swallow them? (#457)
*
* Default is to swallow them.
*
* @type boolean
*/
fallThrough: false,
/**
* @constructor
*
@@ -135,6 +144,9 @@ OpenLayers.Map.prototype = {
*/
initialize: function (div, options) {
//set the default options
this.setOptions(options);
this.div = div = OpenLayers.Util.getElement(div);
// the viewPortDiv is the outermost div we modify
@@ -154,7 +166,7 @@ OpenLayers.Map.prototype = {
this.viewPortDiv.appendChild(this.layerContainerDiv);
this.events = new OpenLayers.Events(this, div, this.EVENT_TYPES);
this.events = new OpenLayers.Events(this, div, this.EVENT_TYPES, this.fallThrough);
this.updateSize();
@@ -172,9 +184,6 @@ OpenLayers.Map.prototype = {
this.updateSize.bindAsEventListener(this));
}
//set the default options
this.setOptions(options);
// only append link stylesheet if the theme property is set
if(this.theme) {
var cssNode = document.createElement('link');