[Mapbender-commits] r3400 - trunk/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Mon Jan 5 04:43:29 EST 2009
Author: christoph
Date: 2009-01-05 04:43:29 -0500 (Mon, 05 Jan 2009)
New Revision: 3400
Modified:
trunk/mapbender/http/javascripts/map_obj.js
Log:
refactoring
Modified: trunk/mapbender/http/javascripts/map_obj.js
===================================================================
--- trunk/mapbender/http/javascripts/map_obj.js 2009-01-02 15:27:22 UTC (rev 3399)
+++ trunk/mapbender/http/javascripts/map_obj.js 2009-01-05 09:43:29 UTC (rev 3400)
@@ -37,7 +37,8 @@
if(this.frameName){
document.getElementById(this.frameName).style.width = this.width;
}
- this.domElement.style.width = this.width;
+ var domElement = this.getDomElement();
+ domElement.style.width = this.width;
};
/**
@@ -51,6 +52,13 @@
return parseInt(this.height, 10);
};
+ this.getDomElement = function(){
+ if(this.frameName){
+ return window.frames[this.frameName].document.getElementById(this.elementName);
+ }
+ return document.getElementById(this.elementName);
+ }
+
/**
* set the height of the mapObj
*
@@ -62,7 +70,8 @@
if(this.frameName){
document.getElementById(this.frameName).style.height = this.height;
}
- this.domElement.style.height = this.height;
+ var domElement = this.getDomElement();
+ domElement.style.width = this.width;
};
/**
@@ -167,14 +176,9 @@
this.calculateExtent(wmsExtent);
this.mapURL = [];
- if(this.frameName){
- this.domElement = window.frames[this.frameName].document.getElementById(this.elementName);
- }
- else{
- this.domElement = document.getElementById(this.elementName);
- }
- this.domElement.style.width = this.width;
- this.domElement.style.height = this.height;
+ var domElement = this.getDomElement();
+ domElement.style.width = this.width;
+ domElement.style.height = this.height;
/**
@@ -857,10 +861,6 @@
return true;
};
- this.getDomElement = function(){
- return this.domElement;
- }
-
this.getMousePos = function(e){
if(ie){
if(this.frameName){
More information about the Mapbender_commits
mailing list