From 14a859a60da7c8f631644de07d1ddccf635a1c48 Mon Sep 17 00:00:00 2001 From: Schuyler Erle Date: Sun, 25 Jun 2006 11:29:37 +0000 Subject: [PATCH] Made the layer switcher a bit more responsive in IE. It would be nice if we could figure out how to keep the text from being selected when the switcher is clicked. git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@730 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Control/LayerSwitcher.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/OpenLayers/Control/LayerSwitcher.js b/lib/OpenLayers/Control/LayerSwitcher.js index 79cd9af58a..0327639788 100644 --- a/lib/OpenLayers/Control/LayerSwitcher.js +++ b/lib/OpenLayers/Control/LayerSwitcher.js @@ -143,6 +143,8 @@ OpenLayers.Control.LayerSwitcher.prototype = backdropLabelOuter.style.marginTop = "4px"; backdropLabelOuter.style.marginBottom = "4px"; + this._setEventHandlers(backdropLabelOuter); + // Inner Label - for Rico Corners // var backdropLabel = document.createElement('p'); @@ -191,9 +193,10 @@ OpenLayers.Control.LayerSwitcher.prototype = _setEventHandlers : function(element, labelDiv) { // We only want to respond to a mousedown event. - element.onclick = this.ignoreEvent.bindAsEventListener(this); - element.ondblclick = this.ignoreEvent.bindAsEventListener(this); - element.onmousedown = this.singleClick.bindAsEventListener(this); + element.onclick = this.singleClick.bindAsEventListener(this); + element.ondblclick = this.singleClick.bindAsEventListener(this); + element.onmouseup = this.ignoreEvent.bindAsEventListener(this); + element.onmousedown = this.ignoreEvent.bindAsEventListener(this); // If we are operating on a corner span we need to store a // reference to the actual tab. (See comment about OL #57 fix above.)