From f08462465d7e2f31999dd9a6cf34ad2f69bcac8f Mon Sep 17 00:00:00 2001 From: euzuro Date: Sat, 27 May 2006 01:08:00 +0000 Subject: [PATCH] move Popup to the same design as Marker. Create the div in the constructor. Give popup an events object. git-svn-id: http://svn.openlayers.org/trunk/openlayers@416 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Popup.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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();