diff --git a/lib/OpenLayers/Popup.js b/lib/OpenLayers/Popup.js index 1132d08d00..00f630e338 100644 --- a/lib/OpenLayers/Popup.js +++ b/lib/OpenLayers/Popup.js @@ -104,8 +104,12 @@ OpenLayers.Popup.prototype = { closeImg.style.top = this.padding + "px"; this.div.appendChild(closeImg); - var closeEvents = new OpenLayers.Events(this, closeImg); - closeEvents.register("mousedown", this, this.hide); + var closePopup = function(e) { + this.hide(); + OpenLayers.Event.stop(e); + } + OpenLayers.Event.observe(closeImg, "click", + closePopup.bindAsEventListener(this)); }