From e727450196c405b4e5de5d08181084935d7c79a9 Mon Sep 17 00:00:00 2001 From: euzuro Date: Thu, 25 May 2006 00:27:46 +0000 Subject: [PATCH] no reason for Popup to be using an OpenLayers construct in the declaration phase. make it WIDTH and HEIGHT instead of using OpenLayers.Size. git-svn-id: http://svn.openlayers.org/trunk/openlayers@338 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Popup.js | 8 ++++++-- tests/test_Popup.html | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/OpenLayers/Popup.js b/lib/OpenLayers/Popup.js index 2b9c536273..839ce4674b 100644 --- a/lib/OpenLayers/Popup.js +++ b/lib/OpenLayers/Popup.js @@ -6,7 +6,8 @@ OpenLayers.Popup = Class.create(); OpenLayers.Popup.count = 0; -OpenLayers.Popup.SIZE = new OpenLayers.Size(200, 200); +OpenLayers.Popup.WIDTH = 200; +OpenLayers.Popup.HEIGHT = 200; OpenLayers.Popup.COLOR = "white"; OpenLayers.Popup.OPACITY = 1; OpenLayers.Popup.BORDER = "0px"; @@ -53,7 +54,10 @@ OpenLayers.Popup.prototype = { OpenLayers.Popup.count += 1; this.id = (id != null) ? id : "Popup" + OpenLayers.Popup.count; this.lonlat = lonlat; - this.size = (size != null) ? size : OpenLayers.Popup.SIZE; + this.size = (size != null) ? size + : new OpenLayers.Size( + OpenLayers.Popup.WIDTH, + OpenLayers.Popup.HEIGHT); if (contentHTML != null) { this.contentHTML = contentHTML; } diff --git a/tests/test_Popup.html b/tests/test_Popup.html index 9ac7b06ba5..e1a474a7a9 100644 --- a/tests/test_Popup.html +++ b/tests/test_Popup.html @@ -11,8 +11,8 @@ t.ok( popup instanceof OpenLayers.Popup, "new OpenLayers.Popup returns Popup object" ); t.ok(popup.id.startsWith("Popup"), "good default popup.id"); - t.eq(popup.size.w, OpenLayers.Popup.SIZE.w, "good default popup.size.w"); - t.eq(popup.size.h, OpenLayers.Popup.SIZE.h, "good default popup.size.h"); + t.eq(popup.size.w, OpenLayers.Popup.WIDTH, "good default popup.size.w"); + t.eq(popup.size.h, OpenLayers.Popup.HEIGHT, "good default popup.size.h"); t.eq(popup.contentHTML, "", "good default popup.contentHTML"); t.eq(popup.backgroundColor, OpenLayers.Popup.COLOR, "good default popup.backgroundColor"); t.eq(popup.opacity, OpenLayers.Popup.OPACITY, "good default popup.opacity");