and a note on manual changes in dataTables.bootstrap.css
[myslice.git] / third-party / jquery-ui-1.10.2 / tests / unit / selectable / selectable_events.js
1 /*
2  * selectable_events.js
3  */
4 (function( $ ) {
5
6 module("selectable: events");
7
8 test( "start", function() {
9         expect( 2 );
10         var el = $("#selectable1");
11         el.selectable({
12                 start: function() {
13                         ok( true, "drag fired start callback" );
14                         equal( this, el[0], "context of callback" );
15                 }
16         });
17         el.simulate( "drag", {
18                 dx: 20,
19                 dy: 20
20         });
21 });
22
23 test( "stop", function() {
24         expect( 2 );
25         var el = $("#selectable1");
26         el.selectable({
27                 start: function() {
28                         ok( true, "drag fired stop callback" );
29                         equal( this, el[0], "context of callback" );
30                 }
31         });
32         el.simulate( "drag", {
33                 dx: 20,
34                 dy: 20
35         });
36 });
37
38 test( "mousedown: initial position of helper", function() {
39         expect( 2 );
40
41         var contentToForceScroll, helper,
42                 element = $("#selectable1").selectable();
43
44         contentToForceScroll = $("<div>").css({
45                 height: "10000px",
46                 width: "10000px"
47         });
48
49         contentToForceScroll.appendTo("body");
50         $( window ).scrollTop( 1 ).scrollLeft( 1 );
51         element.simulate( "mousedown", {
52                 clientX: 10,
53                 clientY: 10
54         });
55
56         helper = $(".ui-selectable-helper");
57         equal( helper.css("top"), "11px", "Scroll top should be accounted for." );
58         equal( helper.css("left"), "11px", "Scroll left should be accounted for." );
59
60         // Cleanup
61         element.simulate("mouseup");
62         contentToForceScroll.remove();
63         $( window ).scrollTop( 0 ).scrollLeft( 0 );
64 });
65
66 })( jQuery );