2009-02-01 00:25:58 +00:00
|
|
|
/*
|
|
|
|
* draggable_options.js
|
|
|
|
*/
|
|
|
|
(function($) {
|
|
|
|
|
|
|
|
module("draggable: options");
|
|
|
|
|
2009-02-01 01:54:28 +00:00
|
|
|
test("{ appendTo: 'parent' }, default", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 2 );
|
2012-12-26 13:08:48 +00:00
|
|
|
var el = $("#draggable2").draggable({ appendTo: "parent" });
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.shouldMove(el);
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
el = $("#draggable1").draggable({ appendTo: "parent" });
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.shouldMove(el);
|
2010-01-28 16:35:59 +00:00
|
|
|
|
2009-02-01 01:54:28 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ appendTo: Element }", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 2 );
|
2012-11-03 20:17:16 +00:00
|
|
|
var el = $("#draggable2").draggable({ appendTo: $("#draggable2").parent()[0] });
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.shouldMove(el);
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2010-01-28 16:35:59 +00:00
|
|
|
el = $("#draggable1").draggable({ appendTo: $("#draggable2").parent()[0] });
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.shouldMove(el);
|
2009-02-01 01:54:28 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ appendTo: Selector }", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 2 );
|
2012-11-03 20:17:16 +00:00
|
|
|
var el = $("#draggable2").draggable({ appendTo: "#main" });
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.shouldMove(el);
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2010-01-28 16:35:59 +00:00
|
|
|
el = $("#draggable1").draggable({ appendTo: "#main" });
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.shouldMove(el);
|
2009-02-01 01:54:28 +00:00
|
|
|
});
|
|
|
|
|
2009-02-01 00:25:58 +00:00
|
|
|
test("{ axis: false }, default", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 1 );
|
2012-11-03 20:17:16 +00:00
|
|
|
var el = $("#draggable2").draggable({ axis: false });
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.shouldMove(el);
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ axis: 'x' }", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 1 );
|
2012-11-03 20:17:16 +00:00
|
|
|
var el = $("#draggable2").draggable({ axis: "x" });
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.testDrag(el, el, 50, 50, 50, 0);
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ axis: 'y' }", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 1 );
|
2012-11-03 20:17:16 +00:00
|
|
|
var el = $("#draggable2").draggable({ axis: "y" });
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.testDrag(el, el, 50, 50, 0, 50);
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ axis: ? }, unexpected", function() {
|
2012-11-03 20:17:16 +00:00
|
|
|
var el,
|
|
|
|
unexpected = {
|
|
|
|
"true": true,
|
|
|
|
"{}": {},
|
|
|
|
"[]": [],
|
|
|
|
"null": null,
|
|
|
|
"undefined": undefined,
|
|
|
|
"function() {}": function() {}
|
|
|
|
};
|
2012-10-30 23:12:17 +00:00
|
|
|
|
|
|
|
expect( 6 );
|
|
|
|
|
2009-02-01 00:25:58 +00:00
|
|
|
$.each(unexpected, function(key, val) {
|
|
|
|
el = $("#draggable2").draggable({ axis: val });
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.testDrag(el, el, 50, 50, 50, 50, "axis: " + key);
|
2009-02-01 00:25:58 +00:00
|
|
|
el.draggable("destroy");
|
2012-04-19 14:27:06 +00:00
|
|
|
});
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
2012-05-21 18:49:49 +00:00
|
|
|
test("{ cancel: 'input,textarea,button,select,option' }, default", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 2 );
|
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
$("<div id='draggable-option-cancel-default'><input type='text'></div>").appendTo("#main");
|
2009-02-01 01:54:28 +00:00
|
|
|
|
2012-11-03 20:17:16 +00:00
|
|
|
var el = $("#draggable-option-cancel-default").draggable({ cancel: "input,textarea,button,select,option" });
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.shouldMove(el);
|
2009-02-01 01:54:28 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
el.draggable("destroy");
|
2009-02-01 01:54:28 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
el = $("#draggable-option-cancel-default").draggable({ cancel: "input,textarea,button,select,option" });
|
|
|
|
TestHelpers.draggable.testDrag(el, "#draggable-option-cancel-default input", 50, 50, 0, 0);
|
2009-02-01 01:54:28 +00:00
|
|
|
el.draggable("destroy");
|
|
|
|
});
|
|
|
|
|
2009-02-01 00:25:58 +00:00
|
|
|
test("{ cancel: 'span' }", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 2 );
|
|
|
|
|
2012-11-03 20:17:16 +00:00
|
|
|
var el = $("#draggable2").draggable();
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.testDrag(el, "#draggable2 span", 50, 50, 50, 50);
|
2009-02-01 00:25:58 +00:00
|
|
|
|
|
|
|
el.draggable("destroy");
|
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
el = $("#draggable2").draggable({ cancel: "span" });
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.testDrag(el, "#draggable2 span", 50, 50, 0, 0);
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ cancel: ? }, unexpected", function() {
|
2012-11-03 20:17:16 +00:00
|
|
|
var el,
|
|
|
|
unexpected = {
|
|
|
|
"true": true,
|
|
|
|
"false": false,
|
|
|
|
"{}": {},
|
|
|
|
"[]": [],
|
|
|
|
"null": null,
|
2012-12-21 17:01:23 +00:00
|
|
|
"undefined": undefined
|
2012-11-03 20:17:16 +00:00
|
|
|
};
|
2012-10-30 23:12:17 +00:00
|
|
|
|
2012-12-21 17:01:23 +00:00
|
|
|
expect( 6 );
|
2012-10-30 23:12:17 +00:00
|
|
|
|
2009-02-01 00:25:58 +00:00
|
|
|
$.each(unexpected, function(key, val) {
|
|
|
|
el = $("#draggable2").draggable({ cancel: val });
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.shouldMove(el, "cancel: " + key);
|
2009-02-01 00:25:58 +00:00
|
|
|
el.draggable("destroy");
|
2012-04-19 14:27:06 +00:00
|
|
|
});
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
/*
|
2009-02-01 01:54:28 +00:00
|
|
|
test("{ containment: false }, default", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 1 );
|
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
ok(false, "missing test - untested code is broken code");
|
2009-02-01 01:54:28 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ containment: Element }", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 1 );
|
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
ok(false, "missing test - untested code is broken code");
|
2009-02-01 01:54:28 +00:00
|
|
|
});
|
2012-10-30 23:12:17 +00:00
|
|
|
*/
|
2009-02-01 01:54:28 +00:00
|
|
|
|
2009-02-01 00:25:58 +00:00
|
|
|
test("{ containment: 'parent' }, relative", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 1 );
|
|
|
|
|
2012-11-03 20:17:16 +00:00
|
|
|
var offsetAfter,
|
2012-12-26 13:08:48 +00:00
|
|
|
el = $("#draggable1").draggable({ containment: "parent" }),
|
2012-11-03 20:17:16 +00:00
|
|
|
p = el.parent(),
|
2012-04-19 14:27:06 +00:00
|
|
|
po = p.offset(),
|
|
|
|
expected = {
|
2012-12-26 13:08:48 +00:00
|
|
|
left: po.left + TestHelpers.draggable.border(p, "left") + TestHelpers.draggable.margin(el, "left"),
|
|
|
|
top: po.top + TestHelpers.draggable.border(p, "top") + TestHelpers.draggable.margin(el, "top")
|
2012-11-03 20:17:16 +00:00
|
|
|
};
|
2012-12-09 02:27:37 +00:00
|
|
|
|
|
|
|
el.simulate( "drag", {
|
|
|
|
dx: -100,
|
|
|
|
dy: -100
|
|
|
|
});
|
2012-11-03 20:17:16 +00:00
|
|
|
offsetAfter = el.offset();
|
2012-12-26 13:08:48 +00:00
|
|
|
deepEqual(offsetAfter, expected, "compare offset to parent");
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ containment: 'parent' }, absolute", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 1 );
|
|
|
|
|
2012-11-03 20:17:16 +00:00
|
|
|
var offsetAfter,
|
2012-12-26 13:08:48 +00:00
|
|
|
el = $("#draggable2").draggable({ containment: "parent" }),
|
2012-11-03 20:17:16 +00:00
|
|
|
p = el.parent(),
|
2012-04-19 14:27:06 +00:00
|
|
|
po = p.offset(),
|
|
|
|
expected = {
|
2012-12-26 13:08:48 +00:00
|
|
|
left: po.left + TestHelpers.draggable.border(p, "left") + TestHelpers.draggable.margin(el, "left"),
|
|
|
|
top: po.top + TestHelpers.draggable.border(p, "top") + TestHelpers.draggable.margin(el, "top")
|
2012-11-03 20:17:16 +00:00
|
|
|
};
|
2012-12-09 02:27:37 +00:00
|
|
|
|
|
|
|
el.simulate( "drag", {
|
|
|
|
dx: -100,
|
|
|
|
dy: -100
|
|
|
|
});
|
2012-11-03 20:17:16 +00:00
|
|
|
offsetAfter = el.offset();
|
2012-12-26 13:08:48 +00:00
|
|
|
deepEqual(offsetAfter, expected, "compare offset to parent");
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
/*
|
2009-02-01 01:54:28 +00:00
|
|
|
test("{ containment: 'document' }", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 1 );
|
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
ok(false, "missing test - untested code is broken code");
|
2009-02-01 01:54:28 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ containment: 'window' }", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 1 );
|
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
ok(false, "missing test - untested code is broken code");
|
2009-02-01 01:54:28 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ containment: Selector }", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 1 );
|
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
ok(false, "missing test - untested code is broken code");
|
2009-02-01 01:54:28 +00:00
|
|
|
});
|
|
|
|
|
2010-07-15 17:16:07 +00:00
|
|
|
test("{ containment: [x1, y1, x2, y2] }", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 1 );
|
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
ok(false, "missing test - untested code is broken code");
|
2010-07-15 17:16:07 +00:00
|
|
|
});
|
2012-10-30 23:12:17 +00:00
|
|
|
*/
|
2010-07-15 17:16:07 +00:00
|
|
|
|
2009-02-01 01:54:28 +00:00
|
|
|
test("{ cursor: 'auto' }, default", function() {
|
|
|
|
function getCursor() { return $("#draggable2").css("cursor"); }
|
|
|
|
|
2012-04-19 14:27:06 +00:00
|
|
|
expect(2);
|
2009-02-01 01:54:28 +00:00
|
|
|
|
2012-12-09 02:27:37 +00:00
|
|
|
var actual, before, after,
|
|
|
|
expected = "auto",
|
|
|
|
el = $("#draggable2").draggable({
|
|
|
|
cursor: expected,
|
|
|
|
start: function() {
|
|
|
|
actual = getCursor();
|
|
|
|
}
|
|
|
|
});
|
2009-02-01 01:54:28 +00:00
|
|
|
|
|
|
|
before = getCursor();
|
2012-12-09 02:27:37 +00:00
|
|
|
el.simulate( "drag", {
|
|
|
|
dx: -1,
|
|
|
|
dy: -1
|
|
|
|
});
|
2009-02-01 01:54:28 +00:00
|
|
|
after = getCursor();
|
|
|
|
|
2012-02-28 14:56:32 +00:00
|
|
|
equal(actual, expected, "start callback: cursor '" + expected + "'");
|
|
|
|
equal(after, before, "after drag: cursor restored");
|
2009-02-01 01:54:28 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|
2009-02-01 00:25:58 +00:00
|
|
|
test("{ cursor: 'move' }", function() {
|
|
|
|
|
|
|
|
function getCursor() { return $("body").css("cursor"); }
|
|
|
|
|
|
|
|
expect(2);
|
|
|
|
|
2012-12-09 02:27:37 +00:00
|
|
|
var actual, before, after,
|
|
|
|
expected = "move",
|
|
|
|
el = $("#draggable2").draggable({
|
|
|
|
cursor: expected,
|
|
|
|
start: function() {
|
|
|
|
actual = getCursor();
|
|
|
|
}
|
|
|
|
});
|
2009-02-01 00:25:58 +00:00
|
|
|
|
|
|
|
before = getCursor();
|
2012-12-09 02:27:37 +00:00
|
|
|
el.simulate( "drag", {
|
|
|
|
dx: -1,
|
|
|
|
dy: -1
|
|
|
|
});
|
2009-02-01 00:25:58 +00:00
|
|
|
after = getCursor();
|
|
|
|
|
2012-02-28 14:56:32 +00:00
|
|
|
equal(actual, expected, "start callback: cursor '" + expected + "'");
|
|
|
|
equal(after, before, "after drag: cursor restored");
|
2009-02-01 00:25:58 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|
2013-01-02 04:16:12 +00:00
|
|
|
test( "cursorAt", function() {
|
|
|
|
expect( 24 );
|
2009-08-03 13:13:13 +00:00
|
|
|
|
2012-12-22 22:39:36 +00:00
|
|
|
var deltaX = -3,
|
|
|
|
deltaY = -3,
|
2012-12-22 21:30:27 +00:00
|
|
|
tests = {
|
2013-01-02 04:16:12 +00:00
|
|
|
"false": { cursorAt : false },
|
2012-12-22 21:30:27 +00:00
|
|
|
"{ left: -5, top: -5 }": { x: -5, y: -5, cursorAt : { left: -5, top: -5 } },
|
2013-01-02 02:59:18 +00:00
|
|
|
"[ 10, 20 ]": { x: 10, y: 20, cursorAt : [ 10, 20 ] },
|
2013-01-02 03:15:03 +00:00
|
|
|
"'10 20'": { x: 10, y: 20, cursorAt : "10 20" },
|
2012-12-22 21:30:27 +00:00
|
|
|
"{ left: 20, top: 40 }": { x: 20, y: 40, cursorAt : { left: 20, top: 40 } },
|
|
|
|
"{ right: 10, bottom: 20 }": { x: 10, y: 20, cursorAt : { right: 10, bottom: 20 } }
|
2012-10-30 23:12:17 +00:00
|
|
|
};
|
2009-08-03 13:13:13 +00:00
|
|
|
|
2012-12-22 21:30:27 +00:00
|
|
|
$.each( tests, function( testName, testData ) {
|
|
|
|
$.each( [ "relative", "absolute" ], function( i, position ) {
|
|
|
|
var el = $( "#draggable" + ( i + 1 ) ).draggable({
|
|
|
|
cursorAt: testData.cursorAt,
|
|
|
|
drag: function( event, ui ) {
|
2013-01-02 04:16:12 +00:00
|
|
|
if( !testData.cursorAt ) {
|
|
|
|
equal( ui.position.left - ui.originalPosition.left, deltaX, testName + " " + position + " left" );
|
|
|
|
equal( ui.position.top - ui.originalPosition.top, deltaY, testName + " " + position + " top" );
|
|
|
|
} else if( testData.cursorAt.right ) {
|
2012-12-27 15:39:14 +00:00
|
|
|
equal( ui.helper.width() - ( event.clientX - ui.offset.left ), testData.x - TestHelpers.draggable.unreliableOffset, testName + " " + position + " left" );
|
2013-01-02 04:16:12 +00:00
|
|
|
equal( ui.helper.height() - ( event.clientY - ui.offset.top ), testData.y - TestHelpers.draggable.unreliableOffset, testName + " " +position + " top" );
|
2012-12-22 21:30:27 +00:00
|
|
|
} else {
|
2012-12-22 22:39:36 +00:00
|
|
|
equal( event.clientX - ui.offset.left, testData.x + TestHelpers.draggable.unreliableOffset, testName + " " + position + " left" );
|
|
|
|
equal( event.clientY - ui.offset.top, testData.y + TestHelpers.draggable.unreliableOffset, testName + " " + position + " top" );
|
2012-12-22 21:30:27 +00:00
|
|
|
}
|
|
|
|
}
|
2012-11-03 20:17:16 +00:00
|
|
|
});
|
|
|
|
|
2012-12-22 21:30:27 +00:00
|
|
|
el.simulate( "drag", {
|
|
|
|
moves: 1,
|
|
|
|
dx: deltaX,
|
|
|
|
dy: deltaY
|
2012-11-03 20:17:16 +00:00
|
|
|
});
|
2012-12-22 21:30:27 +00:00
|
|
|
});
|
2009-08-03 13:13:13 +00:00
|
|
|
});
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ grid: [50, 50] }, relative", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 2 );
|
|
|
|
|
2012-11-03 20:17:16 +00:00
|
|
|
var el = $("#draggable1").draggable({ grid: [50, 50] });
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.testDrag(el, el, 24, 24, 0, 0);
|
|
|
|
TestHelpers.draggable.testDrag(el, el, 26, 25, 50, 50);
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ grid: [50, 50] }, absolute", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 2 );
|
|
|
|
|
2012-11-03 20:17:16 +00:00
|
|
|
var el = $("#draggable2").draggable({ grid: [50, 50] });
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.testDrag(el, el, 24, 24, 0, 0);
|
|
|
|
TestHelpers.draggable.testDrag(el, el, 26, 25, 50, 50);
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ handle: 'span' }", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 2 );
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
var el = $("#draggable2").draggable({ handle: "span" });
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.testDrag(el, "#draggable2 span", 50, 50, 50, 50, "drag span");
|
|
|
|
TestHelpers.draggable.shouldNotMove(el, "drag element");
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ helper: 'clone' }, relative", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 1 );
|
|
|
|
|
2012-11-03 20:17:16 +00:00
|
|
|
var el = $("#draggable1").draggable({ helper: "clone" });
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.shouldNotMove(el);
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ helper: 'clone' }, absolute", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 1 );
|
|
|
|
|
2012-11-03 20:17:16 +00:00
|
|
|
var el = $("#draggable2").draggable({ helper: "clone" });
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.shouldNotMove(el);
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ helper: 'original' }, relative, with scroll offset on parent", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 3 );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-11-03 20:17:16 +00:00
|
|
|
var el = $("#draggable1").draggable({ helper: "original" });
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.setScroll();
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.testScroll(el, "relative");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.setScroll();
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.testScroll(el, "static");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.setScroll();
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.testScroll(el, "absolute");
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.restoreScroll();
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ helper: 'original' }, relative, with scroll offset on root", function() {
|
2012-10-30 23:12:17 +00:00
|
|
|
expect( 3 );
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-11-03 20:17:16 +00:00
|
|
|
var el = $("#draggable1").draggable({ helper: "original" });
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.setScroll("root");
|
|
|
|
TestHelpers.draggable.testScroll(el, "relative");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.setScroll("root");
|
|
|
|
TestHelpers.draggable.testScroll(el, "static");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.setScroll("root");
|
|
|
|
TestHelpers.draggable.testScroll(el, "absolute");
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.restoreScroll("root");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ helper: 'original' }, relative, with scroll offset on root and parent", function() {
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
expect(3);
|
|
|
|
|
2012-11-03 20:17:16 +00:00
|
|
|
var el = $("#draggable1").draggable({ helper: "original" });
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.setScroll();
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.setScroll("root");
|
|
|
|
TestHelpers.draggable.testScroll(el, "relative");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.setScroll();
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.setScroll("root");
|
|
|
|
TestHelpers.draggable.testScroll(el, "static");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.setScroll();
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.setScroll("root");
|
|
|
|
TestHelpers.draggable.testScroll(el, "absolute");
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.restoreScroll();
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.restoreScroll("root");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ helper: 'original' }, absolute, with scroll offset on parent", function() {
|
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
expect(3);
|
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
var el = $("#draggable1").css({ position: "absolute", top: 0, left: 0 }).draggable({ helper: "original" });
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.setScroll();
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.testScroll(el, "relative");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.setScroll();
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.testScroll(el, "static");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.setScroll();
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.testScroll(el, "absolute");
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.restoreScroll();
|
2009-02-01 00:25:58 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
test("{ helper: 'original' }, absolute, with scroll offset on root", function() {
|
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
expect(3);
|
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
var el = $("#draggable1").css({ position: "absolute", top: 0, left: 0 }).draggable({ helper: "original" });
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.setScroll("root");
|
|
|
|
TestHelpers.draggable.testScroll(el, "relative");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.setScroll("root");
|
|
|
|
TestHelpers.draggable.testScroll(el, "static");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.setScroll("root");
|
|
|
|
TestHelpers.draggable.testScroll(el, "absolute");
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.restoreScroll("root");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ helper: 'original' }, absolute, with scroll offset on root and parent", function() {
|
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
expect(3);
|
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
var el = $("#draggable1").css({ position: "absolute", top: 0, left: 0 }).draggable({ helper: "original" });
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.setScroll();
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.setScroll("root");
|
|
|
|
TestHelpers.draggable.testScroll(el, "relative");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.setScroll();
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.setScroll("root");
|
|
|
|
TestHelpers.draggable.testScroll(el, "static");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.setScroll();
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.setScroll("root");
|
|
|
|
TestHelpers.draggable.testScroll(el, "absolute");
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.restoreScroll();
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.restoreScroll("root");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ helper: 'original' }, fixed, with scroll offset on parent", function() {
|
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
expect(3);
|
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
var el = $("#draggable1").css({ position: "fixed", top: 0, left: 0 }).draggable({ helper: "original" });
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.setScroll();
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.testScroll(el, "relative");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.setScroll();
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.testScroll(el, "static");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.setScroll();
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.testScroll(el, "absolute");
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.restoreScroll();
|
2009-02-01 00:25:58 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
test("{ helper: 'original' }, fixed, with scroll offset on root", function() {
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
expect(3);
|
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
var el = $("#draggable1").css({ position: "fixed", top: 0, left: 0 }).draggable({ helper: "original" });
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.setScroll("root");
|
|
|
|
TestHelpers.draggable.testScroll(el, "relative");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.setScroll("root");
|
|
|
|
TestHelpers.draggable.testScroll(el, "static");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.setScroll("root");
|
|
|
|
TestHelpers.draggable.testScroll(el, "absolute");
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.restoreScroll("root");
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ helper: 'original' }, fixed, with scroll offset on root and parent", function() {
|
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
expect(3);
|
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
var el = $("#draggable1").css({ position: "fixed", top: 0, left: 0 }).draggable({ helper: "original" });
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.setScroll();
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.setScroll("root");
|
|
|
|
TestHelpers.draggable.testScroll(el, "relative");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.setScroll();
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.setScroll("root");
|
|
|
|
TestHelpers.draggable.testScroll(el, "static");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.setScroll();
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.setScroll("root");
|
|
|
|
TestHelpers.draggable.testScroll(el, "absolute");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.restoreScroll();
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.restoreScroll("root");
|
2009-02-01 00:25:58 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
test("{ helper: 'clone' }, absolute", function() {
|
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
expect(1);
|
|
|
|
|
2012-04-19 14:27:06 +00:00
|
|
|
var helperOffset = null,
|
2012-11-03 20:17:16 +00:00
|
|
|
origOffset = $("#draggable1").offset(),
|
|
|
|
el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) {
|
|
|
|
helperOffset = ui.helper.offset();
|
|
|
|
} });
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-12-09 02:27:37 +00:00
|
|
|
el.simulate( "drag", {
|
|
|
|
dx: 1,
|
|
|
|
dy: 1
|
|
|
|
});
|
2012-12-26 13:08:48 +00:00
|
|
|
deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] ");
|
2009-02-01 00:25:58 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
test("{ helper: 'clone' }, absolute with scroll offset on parent", function() {
|
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
expect(3);
|
|
|
|
|
|
|
|
TestHelpers.draggable.setScroll();
|
2012-04-19 14:27:06 +00:00
|
|
|
var helperOffset = null,
|
2012-11-03 20:17:16 +00:00
|
|
|
origOffset = null,
|
|
|
|
el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) {
|
|
|
|
helperOffset = ui.helper.offset();
|
|
|
|
} });
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
$("#main").css("position", "relative");
|
2009-02-01 00:25:58 +00:00
|
|
|
origOffset = $("#draggable1").offset();
|
2012-12-09 02:27:37 +00:00
|
|
|
el.simulate( "drag", {
|
|
|
|
dx: 1,
|
|
|
|
dy: 1
|
|
|
|
});
|
2012-12-26 13:08:48 +00:00
|
|
|
deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] ");
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
$("#main").css("position", "static");
|
2009-02-01 00:25:58 +00:00
|
|
|
origOffset = $("#draggable1").offset();
|
2012-12-09 02:27:37 +00:00
|
|
|
el.simulate( "drag", {
|
|
|
|
dx: 1,
|
|
|
|
dy: 1
|
|
|
|
});
|
2012-12-26 13:08:48 +00:00
|
|
|
deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] ");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
$("#main").css("position", "absolute");
|
2009-02-01 00:25:58 +00:00
|
|
|
origOffset = $("#draggable1").offset();
|
2012-12-09 02:27:37 +00:00
|
|
|
el.simulate( "drag", {
|
|
|
|
dx: 1,
|
|
|
|
dy: 1
|
|
|
|
});
|
2012-12-26 13:08:48 +00:00
|
|
|
deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] ");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.restoreScroll();
|
2009-02-01 00:25:58 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
test("{ helper: 'clone' }, absolute with scroll offset on root", function() {
|
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
expect(3);
|
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.setScroll("root");
|
2012-04-19 14:27:06 +00:00
|
|
|
var helperOffset = null,
|
2012-11-03 20:17:16 +00:00
|
|
|
origOffset = null,
|
|
|
|
el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) {
|
|
|
|
helperOffset = ui.helper.offset();
|
|
|
|
} });
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
$("#main").css("position", "relative");
|
2009-02-01 00:25:58 +00:00
|
|
|
origOffset = $("#draggable1").offset();
|
2012-12-09 02:27:37 +00:00
|
|
|
el.simulate( "drag", {
|
|
|
|
dx: 1,
|
|
|
|
dy: 1
|
|
|
|
});
|
2012-12-26 13:08:48 +00:00
|
|
|
deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] ");
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
$("#main").css("position", "static");
|
2009-02-01 00:25:58 +00:00
|
|
|
origOffset = $("#draggable1").offset();
|
2012-12-09 02:27:37 +00:00
|
|
|
el.simulate( "drag", {
|
|
|
|
dx: 1,
|
|
|
|
dy: 1
|
|
|
|
});
|
2012-12-26 13:08:48 +00:00
|
|
|
deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] ");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
$("#main").css("position", "absolute");
|
2009-02-01 00:25:58 +00:00
|
|
|
origOffset = $("#draggable1").offset();
|
2012-12-09 02:27:37 +00:00
|
|
|
el.simulate( "drag", {
|
|
|
|
dx: 1,
|
|
|
|
dy: 1
|
|
|
|
});
|
2012-12-26 13:08:48 +00:00
|
|
|
deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] ");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.restoreScroll("root");
|
2009-02-01 00:25:58 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
test("{ helper: 'clone' }, absolute with scroll offset on root and parent", function() {
|
|
|
|
|
2012-10-30 23:12:17 +00:00
|
|
|
expect(3);
|
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.setScroll("root");
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.setScroll();
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-11-03 20:17:16 +00:00
|
|
|
var helperOffset = null,
|
|
|
|
origOffset = null,
|
|
|
|
el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) {
|
|
|
|
helperOffset = ui.helper.offset();
|
|
|
|
} });
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
$("#main").css("position", "relative");
|
2012-04-19 14:27:06 +00:00
|
|
|
origOffset = $("#draggable1").offset();
|
2012-12-09 02:27:37 +00:00
|
|
|
el.simulate( "drag", {
|
|
|
|
dx: 1,
|
|
|
|
dy: 1
|
|
|
|
});
|
2012-12-26 13:08:48 +00:00
|
|
|
deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] ");
|
2009-02-01 00:25:58 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
$("#main").css("position", "static");
|
2012-04-19 14:27:06 +00:00
|
|
|
origOffset = $("#draggable1").offset();
|
2012-12-09 02:27:37 +00:00
|
|
|
el.simulate( "drag", {
|
|
|
|
dx: 1,
|
|
|
|
dy: 1
|
|
|
|
});
|
2012-12-26 13:08:48 +00:00
|
|
|
deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] ");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
$("#main").css("position", "absolute");
|
2012-04-19 14:27:06 +00:00
|
|
|
origOffset = $("#draggable1").offset();
|
2012-12-09 02:27:37 +00:00
|
|
|
el.simulate( "drag", {
|
|
|
|
dx: 1,
|
|
|
|
dy: 1
|
|
|
|
});
|
2012-12-26 13:08:48 +00:00
|
|
|
deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] ");
|
2012-02-28 14:56:32 +00:00
|
|
|
|
2012-12-26 13:08:48 +00:00
|
|
|
TestHelpers.draggable.restoreScroll("root");
|
2012-10-30 23:12:17 +00:00
|
|
|
TestHelpers.draggable.restoreScroll();
|
2009-02-01 00:25:58 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
test("{ opacity: 0.5 }", function() {
|
|
|
|
|
|
|
|
expect(1);
|
|
|
|
|
2012-12-09 02:27:37 +00:00
|
|
|
var opacity = null,
|
|
|
|
el = $("#draggable2").draggable({
|
|
|
|
opacity: 0.5,
|
|
|
|
start: function() {
|
|
|
|
opacity = $(this).css("opacity");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
el.simulate( "drag", {
|
|
|
|
dx: -1,
|
|
|
|
dy: -1
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
2012-02-28 14:56:32 +00:00
|
|
|
equal(opacity, 0.5, "start callback: opacity is");
|
2009-02-01 00:25:58 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
test("{ zIndex: 10 }", function() {
|
|
|
|
|
|
|
|
expect(1);
|
|
|
|
|
2012-04-19 14:27:06 +00:00
|
|
|
var actual,
|
2012-12-09 02:27:37 +00:00
|
|
|
expected = 10,
|
|
|
|
el = $("#draggable2").draggable({
|
|
|
|
zIndex: expected,
|
|
|
|
start: function() {
|
|
|
|
actual = $(this).css("zIndex");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
el.simulate( "drag", {
|
|
|
|
dx: -1,
|
|
|
|
dy: -1
|
2009-02-01 00:25:58 +00:00
|
|
|
});
|
|
|
|
|
2012-02-28 14:56:32 +00:00
|
|
|
equal(actual, expected, "start callback: zIndex is");
|
2009-02-01 00:25:58 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
})(jQuery);
|