Skip to content
Permalink
Browse files

Dev: fix IE fails in draggable and selectable - Fixed #8770 Dev: Remo…

…ve globals and Standardize Test Suite
  • Loading branch information...
mikesherov committed Nov 4, 2012
1 parent 3df9ea2 commit 068d597166468470dd8c7888a9f892f0ae4bedb5
@@ -24,8 +24,8 @@ test("element types", function() {
offsetBefore = el.offset();
TestHelpers.draggable.drag(el, 50, 50);
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
ok(offsetAfter.left - offsetBefore.left - 50 < 1 && offsetAfter.top - offsetBefore.top - 50 < 1, 'dragged[50, 50] ' + "&lt;" + typeName + "&gt;");
// 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] " + "&lt;" + typeName + "&gt;" );
el.draggable("destroy");
el.remove();
});
@@ -26,7 +26,7 @@ test("autoRefresh", function() {
TestHelpers.selectable.drag(el, 1000, 1000);
equal(actual, 0);
sel.show();
TestHelpers.selectable.drag(el, 1000, 1000);
TestHelpers.selectable.drag( sel[ 0 ], 1000, 1000 );
equal(actual, sel.length);
el.selectable("destroy");
sel.show();
@@ -1,12 +1,8 @@
TestHelpers.selectable = {
drag: function(el, dx, dy) {
var off = el.offset(),
pos = { clientX: off.left, clientY: off.top };
el.simulate("mousedown", pos);
$(document).simulate("mousemove", pos);
pos.clientX += dx;
pos.clientY += dy;
$(document).simulate("mousemove", pos);
$(document).simulate("mouseup", pos);
drag: function( el, dx, dy ) {
$( el ).simulate( "drag", {
dx: dx || 0,
dy: dy || 0
});
}
};

0 comments on commit 068d597

Please sign in to comment.
You can’t perform that action at this time.