mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Dev: fix IE fails in draggable and selectable - Fixed #8770 Dev: Remove globals and Standardize Test Suite
This commit is contained in:
parent
3df9ea29e6
commit
068d597166
@ -24,8 +24,8 @@ test("element types", function() {
|
|||||||
offsetBefore = el.offset();
|
offsetBefore = el.offset();
|
||||||
TestHelpers.draggable.drag(el, 50, 50);
|
TestHelpers.draggable.drag(el, 50, 50);
|
||||||
offsetAfter = el.offset();
|
offsetAfter = el.offset();
|
||||||
//there are some rounding errors in FF and Chrome, so we can't say equal, we have to settle for close enough
|
// there are some rounding errors in FF, Chrome, and IE9, so we can't say equal, we have to settle for close enough
|
||||||
ok(offsetAfter.left - offsetBefore.left - 50 < 1 && offsetAfter.top - offsetBefore.top - 50 < 1, 'dragged[50, 50] ' + "<" + typeName + ">");
|
ok( offsetAfter.left - offsetBefore.left - 50 <= 1 && offsetAfter.top - offsetBefore.top - 50 <= 1, "dragged[50, 50] " + "<" + typeName + ">" );
|
||||||
el.draggable("destroy");
|
el.draggable("destroy");
|
||||||
el.remove();
|
el.remove();
|
||||||
});
|
});
|
||||||
|
@ -26,7 +26,7 @@ test("autoRefresh", function() {
|
|||||||
TestHelpers.selectable.drag(el, 1000, 1000);
|
TestHelpers.selectable.drag(el, 1000, 1000);
|
||||||
equal(actual, 0);
|
equal(actual, 0);
|
||||||
sel.show();
|
sel.show();
|
||||||
TestHelpers.selectable.drag(el, 1000, 1000);
|
TestHelpers.selectable.drag( sel[ 0 ], 1000, 1000 );
|
||||||
equal(actual, sel.length);
|
equal(actual, sel.length);
|
||||||
el.selectable("destroy");
|
el.selectable("destroy");
|
||||||
sel.show();
|
sel.show();
|
||||||
|
@ -1,12 +1,8 @@
|
|||||||
TestHelpers.selectable = {
|
TestHelpers.selectable = {
|
||||||
drag: function( el, dx, dy ) {
|
drag: function( el, dx, dy ) {
|
||||||
var off = el.offset(),
|
$( el ).simulate( "drag", {
|
||||||
pos = { clientX: off.left, clientY: off.top };
|
dx: dx || 0,
|
||||||
el.simulate("mousedown", pos);
|
dy: dy || 0
|
||||||
$(document).simulate("mousemove", pos);
|
});
|
||||||
pos.clientX += dx;
|
|
||||||
pos.clientY += dy;
|
|
||||||
$(document).simulate("mousemove", pos);
|
|
||||||
$(document).simulate("mouseup", pos);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user