now don't use getDimensions any more, but use offsetWidth and offsetHeight before like getDimension does if style.display is not none. r=elemoine,quietriver (pullup #2414)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10278 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2010-05-04 10:00:38 +00:00
parent f66607a6e8
commit b0e726b988
3 changed files with 3 additions and 35 deletions

View File

@@ -1402,11 +1402,9 @@ OpenLayers.Map = OpenLayers.Class({
var size = new OpenLayers.Size(this.div.clientWidth,
this.div.clientHeight);
// Workaround for the fact that hidden elements return 0 for size.
if (size.w == 0 && size.h == 0 || isNaN(size.w) && isNaN(size.h)) {
var dim = OpenLayers.Element.getDimensions(this.div);
size.w = dim.width;
size.h = dim.height;
size.w = this.div.offsetWidth;
size.h = this.div.offsetHeight;
}
if (size.w == 0 && size.h == 0 || isNaN(size.w) && isNaN(size.h)) {
size.w = parseInt(this.div.style.width);