diff --git a/lib/OpenLayers/Popup.js b/lib/OpenLayers/Popup.js index 3c525be786..429fba4a71 100644 --- a/lib/OpenLayers/Popup.js +++ b/lib/OpenLayers/Popup.js @@ -250,18 +250,16 @@ OpenLayers.Popup.prototype = { * hyperlinks or drag-selecting text. */ registerEvents:function() { - Event.observe(this.div, "mousedown", - this.onmousedown.bindAsEventListener(this)); - Event.observe(this.div, "mousemove", - this.onmousemove.bindAsEventListener(this)); - Event.observe(this.div, "mouseup", - this.onmouseup.bindAsEventListener(this)); - Event.observe(this.div, "click", - OpenLayers.Util.safeStopPropagation); - Event.observe(this.div, "mouseout", - this.onmouseout.bindAsEventListener(this)); - Event.observe(this.div, "dblclick", - OpenLayers.Util.safeStopPropagation); + this.events = new OpenLayers.Events(this, this.div, null, true); + + this.events.register("mousedown", this, this.onmousedown); + this.events.register("mousemove", this, this.onmousemove); + this.events.register("mouseup", this, this.onmouseup); + this.events.register("click", this, + OpenLayers.Util.safeStopPropagation); + this.events.register("mouseout", this, this.onmouseout); + this.events.register("dblclick", this, + OpenLayers.Util.safeStopPropagation); }, /** When mouse goes down within the popup, make a note of