From f6a50a37fc3a328a8c68643129fbd1dec31acbd0 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Tue, 22 Aug 2006 18:37:05 +0000 Subject: [PATCH] IE will not catch events on a div which has no content in it. (Why? Who knows!) However, if we set a background on the div, it works -- but not if that background is transparent. It has to have some thing. So, if we're in IE, we use our handy dandy notebook!, er, blank.gif, to populate a background so that the EventPane will work. If someone can fix this, please do. git-svn-id: http://svn.openlayers.org/branches/openlayers/2.0@1332 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- img/blank.gif | Bin 0 -> 42 bytes lib/OpenLayers/Layer/EventPane.js | 11 +++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 img/blank.gif diff --git a/img/blank.gif b/img/blank.gif new file mode 100644 index 0000000000000000000000000000000000000000..4bcc753a12e9854923af4b9b5b9a4b76f1bc53a6 GIT binary patch literal 42 ocmZ?wbhEHbWMp7uXkY+=|Ns9h{$ybUF?B!$NXCJQ(S^Yp0J?7nHvj+t literal 0 HcmV?d00001 diff --git a/lib/OpenLayers/Layer/EventPane.js b/lib/OpenLayers/Layer/EventPane.js index 88460ad3df..24cf56079f 100644 --- a/lib/OpenLayers/Layer/EventPane.js +++ b/lib/OpenLayers/Layer/EventPane.js @@ -37,9 +37,6 @@ OpenLayers.Layer.EventPane.prototype = if (arguments.length > 0) { if (this.pane == null) { this.pane = OpenLayers.Util.createDiv(); - this.pane.style.width = "100%"; - this.pane.style.height = "100%"; - this.pane.style.backgroundColor = "transparent"; } } }, @@ -52,9 +49,15 @@ OpenLayers.Layer.EventPane.prototype = */ setMap: function(map) { OpenLayers.Layer.prototype.setMap.apply(this, arguments); - + this.pane.style.zIndex = parseInt(this.div.style.zIndex) + 1; this.pane.style.display = this.div.style.display; + this.pane.style.width="100%"; + this.pane.style.height="100%"; + if (/MSIE/.test(navigator.userAgent)) { + this.pane.style.background = "url("+OpenLayers.Util.getImagesLocation()+"blank.gif)"; + } + if (this.isFixed) { this.map.viewPortDiv.appendChild(this.pane); } else {