2013-02-26 15:13:42 +00:00
|
|
|
(function( $ ) {
|
2009-02-02 07:09:15 +00:00
|
|
|
|
2013-02-26 15:13:42 +00:00
|
|
|
module( "droppable: events" );
|
2009-02-02 07:09:15 +00:00
|
|
|
|
2013-02-24 05:55:29 +00:00
|
|
|
test( "droppable destruction/recreation on drop event", function() {
|
|
|
|
expect( 1 );
|
|
|
|
|
|
|
|
var config = {
|
|
|
|
activeClass: "active",
|
|
|
|
drop: function() {
|
|
|
|
var element = $( this ),
|
|
|
|
newDroppable = $( "<div>" )
|
|
|
|
.css({ width: 100, height: 100 })
|
|
|
|
.text( "Droppable" );
|
|
|
|
element.after( newDroppable );
|
|
|
|
element.remove();
|
|
|
|
newDroppable.droppable( config );
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
draggable = $( "#draggable1" ).draggable(),
|
|
|
|
droppable1 = $( "#droppable1" ).droppable( config ),
|
|
|
|
droppable2 = $( "#droppable2" ).droppable( config ),
|
|
|
|
|
|
|
|
droppableOffset = droppable1.offset(),
|
|
|
|
draggableOffset = draggable.offset(),
|
|
|
|
dx = droppableOffset.left - draggableOffset.left,
|
|
|
|
dy = droppableOffset.top - draggableOffset.top;
|
|
|
|
|
|
|
|
draggable.simulate( "drag", {
|
|
|
|
dx: dx,
|
|
|
|
dy: dy
|
|
|
|
});
|
|
|
|
|
|
|
|
ok( !droppable2.hasClass( "active" ), "subsequent droppable no longer active" );
|
|
|
|
});
|
|
|
|
|
2013-02-26 15:13:42 +00:00
|
|
|
|
2012-10-23 14:36:42 +00:00
|
|
|
|
2012-10-31 02:19:49 +00:00
|
|
|
// todo: comment the following in when ready to actually test
|
|
|
|
/*
|
2009-02-02 07:09:15 +00:00
|
|
|
test("activate", function() {
|
|
|
|
ok(false, 'missing test - untested code is broken code');
|
|
|
|
});
|
|
|
|
|
|
|
|
test("deactivate", function() {
|
|
|
|
ok(false, 'missing test - untested code is broken code');
|
|
|
|
});
|
|
|
|
|
|
|
|
test("over", function() {
|
|
|
|
ok(false, 'missing test - untested code is broken code');
|
|
|
|
});
|
|
|
|
|
|
|
|
test("out", function() {
|
|
|
|
ok(false, 'missing test - untested code is broken code');
|
|
|
|
});
|
|
|
|
|
|
|
|
test("drop", 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
|
|
|
|
2013-02-26 15:13:42 +00:00
|
|
|
})( jQuery );
|