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

@@ -78,16 +78,16 @@
var testEvt;
// test pause and move callbacks - four tests here (2 from setTimeout above)
testEvt = Math.random();
testEvt = {id: Math.random()};
handler.callbacks = {
"pause": function(evt) {
t.eq(evt, testEvt,
t.eq(evt.id, testEvt.id,
"pause callback called with correct evt");
},
"move": function(evt) {
t.eq(evt, testEvt,
"move callback called with correct evt");
}
},
"move": function(evt) {
t.eq(evt.id, testEvt.id,
"move callback called with correct evt");
}
};
map.events.triggerEvent("mousemove", testEvt);
handler.clearTimer();
@@ -116,7 +116,7 @@
// mouse moves 3x3 pixels, callbacks should be called
handler.callbacks = {
"pause": function(evt) {
t.ok(evt == testEvt, "(pixelTolerance unmet) pause callback called");
t.ok(evt.xy == testEvt.xy, "(pixelTolerance unmet) pause callback called");
},
"move": function(evt) {
t.ok(evt == testEvt, "(pixelTolerance unmet) move callback called");