reverted r10125, which does not fix the described issue, and store style.display instead (first patch attached to #2414). r=bartvde,elemoine (pullup #2414)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10276 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -93,7 +93,6 @@ OpenLayers.Element = {
|
||||
|
||||
/**
|
||||
* APIFunction: getDimensions
|
||||
* *Deprecated*. Returns dimensions of the element passed in.
|
||||
*
|
||||
* Parameters:
|
||||
* element - {DOMElement}
|
||||
|
||||
@@ -1402,6 +1402,12 @@ 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;
|
||||
}
|
||||
if (size.w == 0 && size.h == 0 || isNaN(size.w) && isNaN(size.h)) {
|
||||
size.w = parseInt(this.div.style.width);
|
||||
size.h = parseInt(this.div.style.height);
|
||||
|
||||
Reference in New Issue
Block a user