diff --git a/lib/OpenLayers/Popup.js b/lib/OpenLayers/Popup.js index fdf5eb7229..4c3c62a7e5 100644 --- a/lib/OpenLayers/Popup.js +++ b/lib/OpenLayers/Popup.js @@ -12,6 +12,9 @@ OpenLayers.Popup.BORDER = "0px"; OpenLayers.Popup.prototype = { + /** @type OpenLayers.Events*/ + events: null, + /** @type String */ id: "", @@ -62,6 +65,11 @@ OpenLayers.Popup.prototype = { this.backgroundColor = OpenLayers.Popup.COLOR; this.opacity = OpenLayers.Popup.OPACITY; this.border = OpenLayers.Popup.BORDER; + + this.div = OpenLayers.Util.createDiv(this.id + "_div", null, null, + null, null, null, "hidden"); + + this.events = new OpenLayers.Events(this, this.div, null); }, /** @@ -87,10 +95,6 @@ OpenLayers.Popup.prototype = { } } - if (this.div == null) { - this.div = OpenLayers.Util.createDiv(this.id + "_div", null, null, - null, null, null, "hidden"); - } this.setSize(); this.setBackgroundColor(); this.setOpacity();