|
4 | 4 |
|
5 | 5 | (function( $ ) {
|
6 | 6 |
|
7 |
| -var relativeElement, absoluteElement; |
8 |
| - |
9 |
| -module( "draggable: core", { |
10 |
| - setup: function() { |
11 |
| - relativeElement = $("<div style='width: 200px; height: 100px;'>Relative</div>").appendTo("#qunit-fixture"); |
12 |
| - absoluteElement = $("<div style='background: green; width: 200px; height: 100px; position: absolute; top: 10px; left: 10px;'><span>Absolute</span></div>").appendTo("#qunit-fixture"); |
13 |
| - }, |
14 |
| - teardown: function() { |
15 |
| - relativeElement.remove(); |
16 |
| - absoluteElement.remove(); |
17 |
| - } |
18 |
| -}); |
| 7 | +module( "draggable: core" ); |
19 | 8 |
|
20 | 9 | test( "element types", function() {
|
21 | 10 | var typeNames = (
|
@@ -55,26 +44,26 @@ test( "element types", function() {
|
55 | 44 |
|
56 | 45 | test( "No options, relative", function() {
|
57 | 46 | expect( 1 );
|
58 |
| - TestHelpers.draggable.shouldMove( relativeElement.draggable() ); |
| 47 | + TestHelpers.draggable.shouldMove( $( "#draggable1" ).draggable() ); |
59 | 48 | });
|
60 | 49 |
|
61 | 50 | test( "No options, absolute", function() {
|
62 | 51 | expect( 1 );
|
63 |
| - TestHelpers.draggable.shouldMove( absoluteElement.draggable() ); |
| 52 | + TestHelpers.draggable.shouldMove( $( "#draggable2" ).draggable() ); |
64 | 53 | });
|
65 | 54 |
|
66 | 55 | test( "resizable handle with complex markup (#8756 / #8757)", function() {
|
67 | 56 | expect( 2 );
|
68 | 57 |
|
69 |
| - relativeElement |
| 58 | + $( "#draggable1" ) |
70 | 59 | .append(
|
71 | 60 | $("<div>")
|
72 | 61 | .addClass("ui-resizable-handle ui-resizable-w")
|
73 | 62 | .append( $("<div>") )
|
74 | 63 | );
|
75 | 64 |
|
76 | 65 | var handle = $(".ui-resizable-w div"),
|
77 |
| - target = relativeElement.draggable().resizable({ handles: "all" }); |
| 66 | + target = $( "#draggable1" ).draggable().resizable({ handles: "all" }); |
78 | 67 |
|
79 | 68 | // todo: fix resizable so it doesn't require a mouseover
|
80 | 69 | handle.simulate("mouseover").simulate( "drag", { dx: -50 } );
|
|
0 commit comments