Make the drag handler only call done if it actually dragged - thanks for the review Eric (closes #1118).

git-svn-id: http://svn.openlayers.org/trunk/openlayers@5097 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2007-11-01 20:53:06 +00:00
parent 756f6ca24d
commit ba8354b593
2 changed files with 20 additions and 4 deletions

View File

@@ -87,7 +87,7 @@
}
function test_Handler_Drag_callbacks(t) {
t.plan(33);
t.plan(34);
var map = new OpenLayers.Map('map', {controls: []});
@@ -187,6 +187,14 @@
OpenLayers.Event.isLeftClick = oldIsLeftClick;
handler.checkModifiers = oldCheckModifiers;
// test mouseup before mousemove
var realUp = testEvents.up;
testEvents.up = testEvents.down;
// this will fail with notice about the done callback being called
// if done is called when it shouldn't be
map.events.triggerEvent("mouseup", testEvents.up);
testEvents.up = realUp;
// test mousemove
handler.started = false;
map.events.triggerEvent("mousemove", {xy: {x: null, y: null}});