The click and hover handlers need to take care that the event they are handling doesn't get modified before the delayed listeners get called. Appears to only be a problem in IE. Thanks for the catch madair. r=crschmidt (closes #1393)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@6414 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2008-02-29 07:30:34 +00:00
parent 8b91ee8d64
commit 323de7085b
4 changed files with 18 additions and 12 deletions

View File

@@ -159,7 +159,10 @@ OpenLayers.Handler.Click = OpenLayers.Class(OpenLayers.Handler, {
this.clearTimer();
} else {
// set the timer, send evt only if single is true
var clickEvent = this.single ? evt : null;
//use a clone of the event object because it will no longer
//be a valid event object in IE in the timer callback
var clickEvent = this.single ?
OpenLayers.Util.extend({}, evt) : null;
this.timerId = window.setTimeout(
OpenLayers.Function.bind(this.delayedCall, this, clickEvent),
this.delay

View File

@@ -86,6 +86,9 @@ OpenLayers.Handler.Hover = OpenLayers.Class(OpenLayers.Handler, {
this.clearTimer();
this.callback('move', [evt]);
this.px = evt.xy;
// clone the evt so original properties can be accessed even
// if the browser deletes them during the delay
evt = OpenLayers.Util.extend({}, evt);
this.timerId = window.setTimeout(
OpenLayers.Function.bind(this.delayedCall, this, evt),
this.delay