Create a new reliable updatesize event.

The resize event is not fired in all browsers. What we actually need is an event that is called every time the updateSize method is called.
This commit is contained in:
ahocevar
2012-06-13 21:36:17 +02:00
parent 1d680df6d0
commit 7141d237d9
2 changed files with 4 additions and 2 deletions

View File

@@ -99,7 +99,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
this.map.events.un({
"changebaselayer": this.redraw,
"resize": this.redraw,
"updatesize": this.redraw,
scope: this
});
@@ -119,7 +119,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
OpenLayers.Control.PanZoom.prototype.setMap.apply(this, arguments);
this.map.events.on({
"changebaselayer": this.redraw,
"resize": this.redraw,
"updatesize": this.redraw,
scope: this
});
},

View File

@@ -83,6 +83,7 @@ OpenLayers.Map = OpenLayers.Class({
* mouseout - triggered after mouseout the map
* mousemove - triggered after mousemove the map
* changebaselayer - triggered after the base layer changes
* updatesize - triggered after the <updateSize> method was executed
*/
/**
@@ -1490,6 +1491,7 @@ OpenLayers.Map = OpenLayers.Class({
}
}
this.events.triggerEvent("updatesize");
},
/**