2009-02-02 07:09:15 +00:00
|
|
|
/*
|
2009-02-02 13:23:51 +00:00
|
|
|
* droppable_options.js
|
2009-02-02 07:09:15 +00:00
|
|
|
*/
|
|
|
|
(function($) {
|
|
|
|
|
|
|
|
module("droppable: options");
|
|
|
|
|
2012-10-31 02:19:49 +00:00
|
|
|
/*
|
2009-02-02 13:23:51 +00:00
|
|
|
test("{ accept '*' }, default ", function() {
|
|
|
|
ok(false, 'missing test - untested code is broken code');
|
|
|
|
});
|
|
|
|
|
|
|
|
test("{ accept: Selector }", function() {
|
2009-02-02 07:09:15 +00:00
|
|
|
ok(false, 'missing test - untested code is broken code');
|
|
|
|
});
|
|
|
|
|
2009-02-02 13:23:51 +00:00
|
|
|
test("{ accept: function(draggable) }", function() {
|
2009-02-02 07:09:15 +00:00
|
|
|
ok(false, 'missing test - untested code is broken code');
|
|
|
|
});
|
|
|
|
|
|
|
|
test("activeClass", function() {
|
|
|
|
ok(false, 'missing test - untested code is broken code');
|
|
|
|
});
|
2012-10-31 02:19:49 +00:00
|
|
|
*/
|
2009-02-02 07:14:19 +00:00
|
|
|
test("{ addClasses: true }, default", function() {
|
2012-10-31 02:19:49 +00:00
|
|
|
expect( 1 );
|
2012-11-03 20:17:16 +00:00
|
|
|
var el = $("<div></div>").droppable({ addClasses: true });
|
2009-02-02 07:14:19 +00:00
|
|
|
ok(el.is(".ui-droppable"), "'ui-droppable' class added");
|
2009-02-02 07:18:27 +00:00
|
|
|
el.droppable("destroy");
|
2009-02-02 07:14:19 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
test("{ addClasses: false }", function() {
|
2012-10-31 02:19:49 +00:00
|
|
|
expect( 1 );
|
2012-11-03 20:17:16 +00:00
|
|
|
var el = $("<div></div>").droppable({ addClasses: false });
|
2009-02-02 07:14:19 +00:00
|
|
|
ok(!el.is(".ui-droppable"), "'ui-droppable' class not added");
|
2009-02-02 07:09:15 +00:00
|
|
|
el.droppable("destroy");
|
|
|
|
});
|
2013-10-29 13:48:51 +00:00
|
|
|
|
|
|
|
test( "scope", function() {
|
|
|
|
expect( 4 );
|
|
|
|
var droppableOffset, draggableOffset, oldDraggableOffset, dx, dy,
|
|
|
|
draggable1 = $("<div></div>").appendTo( "#qunit-fixture" ).draggable({ revert: "invalid" }),
|
|
|
|
draggable2 = $("<div></div>").appendTo( "#qunit-fixture" ).droppable(),
|
|
|
|
droppable = $("<div></div>").appendTo( "#qunit-fixture" ).droppable(),
|
|
|
|
newScope = "test";
|
|
|
|
|
|
|
|
draggable1.draggable( "option", "scope", newScope );
|
|
|
|
droppable.droppable( "option", "scope", newScope );
|
|
|
|
|
|
|
|
// Test that droppable accepts draggable with new scope.
|
|
|
|
droppableOffset = droppable.offset();
|
|
|
|
draggableOffset = draggable1.offset();
|
|
|
|
dx = droppableOffset.left - draggableOffset.left;
|
|
|
|
dy = droppableOffset.top - draggableOffset.top;
|
|
|
|
|
|
|
|
draggable1.simulate( "drag", {
|
|
|
|
dx: dx,
|
|
|
|
dy: dy
|
|
|
|
});
|
|
|
|
|
|
|
|
draggableOffset = draggable1.offset();
|
|
|
|
equal( draggableOffset.left, droppableOffset.left );
|
|
|
|
equal( draggableOffset.top, droppableOffset.top );
|
|
|
|
|
|
|
|
// Test that droppable doesn't accept draggable with old scope.
|
|
|
|
draggableOffset = draggable2.offset();
|
|
|
|
dx = droppableOffset.left - draggableOffset.left;
|
|
|
|
dy = droppableOffset.top - draggableOffset.top;
|
|
|
|
oldDraggableOffset = draggableOffset;
|
|
|
|
|
|
|
|
draggable2.simulate( "drag", {
|
|
|
|
dx: dx,
|
|
|
|
dy: dy
|
|
|
|
});
|
|
|
|
|
|
|
|
draggableOffset = draggable2.offset();
|
|
|
|
equal( draggableOffset.left, oldDraggableOffset.left );
|
|
|
|
equal( draggableOffset.top, oldDraggableOffset.top );
|
|
|
|
});
|
2012-10-31 02:19:49 +00:00
|
|
|
/*
|
2009-02-02 07:09:15 +00:00
|
|
|
test("greedy", function() {
|
|
|
|
ok(false, 'missing test - untested code is broken code');
|
|
|
|
});
|
|
|
|
|
|
|
|
test("hoverClass", function() {
|
|
|
|
ok(false, 'missing test - untested code is broken code');
|
|
|
|
});
|
|
|
|
|
|
|
|
test("tolerance, fit", function() {
|
|
|
|
ok(false, 'missing test - untested code is broken code');
|
|
|
|
});
|
|
|
|
|
|
|
|
test("tolerance, intersect", function() {
|
|
|
|
ok(false, 'missing test - untested code is broken code');
|
|
|
|
});
|
|
|
|
|
|
|
|
test("tolerance, pointer", function() {
|
|
|
|
ok(false, 'missing test - untested code is broken code');
|
|
|
|
});
|
|
|
|
|
|
|
|
test("tolerance, touch", function() {
|
|
|
|
ok(false, 'missing test - untested code is broken code');
|
|
|
|
});
|
2012-10-31 02:19:49 +00:00
|
|
|
*/
|
2009-02-02 07:09:15 +00:00
|
|
|
})(jQuery);
|