Cloning event for use in delayed function

In IE, where window.event is used, the event can change during the delay.
To avoid this, we store the event properties in a new object.
This commit is contained in:
ahocevar
2012-12-07 21:09:09 +01:00
parent 1b1e90c268
commit 8701a54603

View File

@@ -183,9 +183,11 @@ OpenLayers.Handler.MouseWheel = OpenLayers.Class(OpenLayers.Handler, {
if(this.interval) {
window.clearTimeout(this._timeoutId);
// store e because window.event might change during delay
var evt = OpenLayers.Util.extend({}, e);
this._timeoutId = window.setTimeout(
OpenLayers.Function.bind(function(){
this.wheelZoom(e);
this.wheelZoom(evt);
}, this),
this.interval
);