Skip to content

Commit 5850a5c

Browse files
committed
Resizable: Style updates
Ref #14246
1 parent 9a015df commit 5850a5c

File tree

7 files changed

+613
-613
lines changed

7 files changed

+613
-613
lines changed

tests/unit/resizable/common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ common.testWidget( "resizable", {
3535
start: null,
3636
stop: null
3737
}
38-
});
38+
} );
3939

4040
} );

tests/unit/resizable/core.js

Lines changed: 94 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ define( [
44
"ui/widgets/resizable"
55
], function( $, testHelper ) {
66

7-
module("resizable: core");
7+
module( "resizable: core" );
88

99
/*
1010
test("element types", function() {
@@ -25,188 +25,188 @@ test("element types", function() {
2525
});
2626
*/
2727

28-
test("n", function() {
29-
expect(4);
28+
test( "n", function() {
29+
expect( 4 );
3030

31-
var handle = ".ui-resizable-n", target = $("#resizable1").resizable({ handles: "all" });
31+
var handle = ".ui-resizable-n", target = $( "#resizable1" ).resizable( { handles: "all" } );
3232

33-
testHelper.drag(handle, 0, -50);
33+
testHelper.drag( handle, 0, -50 );
3434
equal( target.height(), 150, "compare height" );
3535

36-
testHelper.drag(handle, 0, 50);
36+
testHelper.drag( handle, 0, 50 );
3737
equal( target.height(), 100, "compare height" );
3838

39-
equal( target[0].style.left, "", "left should not be modified" );
40-
equal( target[0].style.width, "", "width should not be modified" );
41-
});
39+
equal( target[ 0 ].style.left, "", "left should not be modified" );
40+
equal( target[ 0 ].style.width, "", "width should not be modified" );
41+
} );
4242

43-
test("s", function() {
44-
expect(5);
43+
test( "s", function() {
44+
expect( 5 );
4545

46-
var handle = ".ui-resizable-s", target = $("#resizable1").resizable({ handles: "all" });
46+
var handle = ".ui-resizable-s", target = $( "#resizable1" ).resizable( { handles: "all" } );
4747

48-
testHelper.drag(handle, 0, 50);
48+
testHelper.drag( handle, 0, 50 );
4949
equal( target.height(), 150, "compare height" );
5050

51-
testHelper.drag(handle, 0, -50);
51+
testHelper.drag( handle, 0, -50 );
5252
equal( target.height(), 100, "compare height" );
5353

54-
equal( target[0].style.top, "", "top should not be modified" );
55-
equal( target[0].style.left, "", "left should not be modified" );
56-
equal( target[0].style.width, "", "width should not be modified" );
57-
});
54+
equal( target[ 0 ].style.top, "", "top should not be modified" );
55+
equal( target[ 0 ].style.left, "", "left should not be modified" );
56+
equal( target[ 0 ].style.width, "", "width should not be modified" );
57+
} );
5858

59-
test("e", function() {
60-
expect(5);
59+
test( "e", function() {
60+
expect( 5 );
6161

62-
var handle = ".ui-resizable-e", target = $("#resizable1").resizable({ handles: "all" });
62+
var handle = ".ui-resizable-e", target = $( "#resizable1" ).resizable( { handles: "all" } );
6363

64-
testHelper.drag(handle, 50);
65-
equal( target.width(), 150, "compare width");
64+
testHelper.drag( handle, 50 );
65+
equal( target.width(), 150, "compare width" );
6666

67-
testHelper.drag(handle, -50);
67+
testHelper.drag( handle, -50 );
6868
equal( target.width(), 100, "compare width" );
6969

70-
equal( target[0].style.height, "", "height should not be modified" );
71-
equal( target[0].style.top, "", "top should not be modified" );
72-
equal( target[0].style.left, "", "left should not be modified" );
73-
});
70+
equal( target[ 0 ].style.height, "", "height should not be modified" );
71+
equal( target[ 0 ].style.top, "", "top should not be modified" );
72+
equal( target[ 0 ].style.left, "", "left should not be modified" );
73+
} );
7474

75-
test("w", function() {
76-
expect(4);
75+
test( "w", function() {
76+
expect( 4 );
7777

78-
var handle = ".ui-resizable-w", target = $("#resizable1").resizable({ handles: "all" });
78+
var handle = ".ui-resizable-w", target = $( "#resizable1" ).resizable( { handles: "all" } );
7979

80-
testHelper.drag(handle, -50);
80+
testHelper.drag( handle, -50 );
8181
equal( target.width(), 150, "compare width" );
8282

83-
testHelper.drag(handle, 50);
83+
testHelper.drag( handle, 50 );
8484
equal( target.width(), 100, "compare width" );
8585

86-
equal( target[0].style.height, "", "height should not be modified" );
87-
equal( target[0].style.top, "", "top should not be modified" );
88-
});
86+
equal( target[ 0 ].style.height, "", "height should not be modified" );
87+
equal( target[ 0 ].style.top, "", "top should not be modified" );
88+
} );
8989

90-
test("ne", function() {
91-
expect(5);
90+
test( "ne", function() {
91+
expect( 5 );
9292

93-
var handle = ".ui-resizable-ne", target = $("#resizable1").css({ overflow: "hidden" }).resizable({ handles: "all" });
93+
var handle = ".ui-resizable-ne", target = $( "#resizable1" ).css( { overflow: "hidden" } ).resizable( { handles: "all" } );
9494

95-
testHelper.drag(handle, -50, -50);
95+
testHelper.drag( handle, -50, -50 );
9696
equal( target.width(), 50, "compare width" );
9797
equal( target.height(), 150, "compare height" );
9898

99-
testHelper.drag(handle, 50, 50);
99+
testHelper.drag( handle, 50, 50 );
100100
equal( target.width(), 100, "compare width" );
101101
equal( target.height(), 100, "compare height" );
102102

103-
equal( target[0].style.left, "", "left should not be modified" );
104-
});
103+
equal( target[ 0 ].style.left, "", "left should not be modified" );
104+
} );
105105

106-
test("se", function() {
107-
expect(6);
106+
test( "se", function() {
107+
expect( 6 );
108108

109-
var handle = ".ui-resizable-se", target = $("#resizable1").resizable({ handles: "all" });
109+
var handle = ".ui-resizable-se", target = $( "#resizable1" ).resizable( { handles: "all" } );
110110

111-
testHelper.drag(handle, 50, 50);
111+
testHelper.drag( handle, 50, 50 );
112112
equal( target.width(), 150, "compare width" );
113113
equal( target.height(), 150, "compare height" );
114114

115-
testHelper.drag(handle, -50, -50);
115+
testHelper.drag( handle, -50, -50 );
116116
equal( target.width(), 100, "compare width" );
117117
equal( target.height(), 100, "compare height" );
118118

119-
equal( target[0].style.top, "", "top should not be modified" );
120-
equal( target[0].style.left, "", "left should not be modified" );
121-
});
119+
equal( target[ 0 ].style.top, "", "top should not be modified" );
120+
equal( target[ 0 ].style.left, "", "left should not be modified" );
121+
} );
122122

123-
test("sw", function() {
124-
expect(5);
123+
test( "sw", function() {
124+
expect( 5 );
125125

126-
var handle = ".ui-resizable-sw", target = $("#resizable1").resizable({ handles: "all" });
126+
var handle = ".ui-resizable-sw", target = $( "#resizable1" ).resizable( { handles: "all" } );
127127

128-
testHelper.drag(handle, -50, -50);
128+
testHelper.drag( handle, -50, -50 );
129129
equal( target.width(), 150, "compare width" );
130130
equal( target.height(), 50, "compare height" );
131131

132-
testHelper.drag(handle, 50, 50);
132+
testHelper.drag( handle, 50, 50 );
133133
equal( target.width(), 100, "compare width" );
134134
equal( target.height(), 100, "compare height" );
135135

136-
equal( target[0].style.top, "", "top should not be modified" );
137-
});
136+
equal( target[ 0 ].style.top, "", "top should not be modified" );
137+
} );
138138

139-
test("nw", function() {
140-
expect(4);
139+
test( "nw", function() {
140+
expect( 4 );
141141

142-
var handle = ".ui-resizable-nw", target = $("#resizable1").resizable({ handles: "all" });
142+
var handle = ".ui-resizable-nw", target = $( "#resizable1" ).resizable( { handles: "all" } );
143143

144-
testHelper.drag(handle, -50, -50);
144+
testHelper.drag( handle, -50, -50 );
145145
equal( target.width(), 150, "compare width" );
146146
equal( target.height(), 150, "compare height" );
147147

148-
testHelper.drag(handle, 50, 50);
148+
testHelper.drag( handle, 50, 50 );
149149
equal( target.width(), 100, "compare width" );
150150
equal( target.height(), 100, "compare height" );
151-
});
151+
} );
152152

153-
test("handle with complex markup (#8756)", function() {
154-
expect(2);
153+
test( "handle with complex markup (#8756)", function() {
154+
expect( 2 );
155155

156-
$("#resizable1")
156+
$( "#resizable1" )
157157
.append(
158-
$("<div>")
159-
.addClass("ui-resizable-handle")
160-
.addClass("ui-resizable-w")
161-
.append($("<div>"))
158+
$( "<div>" )
159+
.addClass( "ui-resizable-handle" )
160+
.addClass( "ui-resizable-w" )
161+
.append( $( "<div>" ) )
162162
);
163163

164-
var handle = ".ui-resizable-w div", target = $("#resizable1").resizable({ handles: "all" });
164+
var handle = ".ui-resizable-w div", target = $( "#resizable1" ).resizable( { handles: "all" } );
165165

166-
testHelper.drag(handle, -50);
166+
testHelper.drag( handle, -50 );
167167
equal( target.width(), 150, "compare width" );
168168

169-
testHelper.drag(handle, 50);
169+
testHelper.drag( handle, 50 );
170170
equal( target.width(), 100, "compare width" );
171-
});
171+
} );
172172

173-
test("resizable accounts for scroll position correctly (#3815)", function() {
173+
test( "resizable accounts for scroll position correctly (#3815)", function() {
174174
expect( 4 );
175175

176176
var position, top, left,
177-
container = $("<div style='overflow:scroll;height:300px;width:300px;position:relative;'></div>").appendTo("#qunit-fixture"),
178-
overflowed = $("<div style='width: 1000px; height: 1000px;'></div>").appendTo( container ),
179-
el = $("<div style='height:100px;width:100px;position:absolute;top:10px;left:10px;'></div>").appendTo( overflowed ).resizable({ handles: "all" }),
177+
container = $( "<div style='overflow:scroll;height:300px;width:300px;position:relative;'></div>" ).appendTo( "#qunit-fixture" ),
178+
overflowed = $( "<div style='width: 1000px; height: 1000px;'></div>" ).appendTo( container ),
179+
el = $( "<div style='height:100px;width:100px;position:absolute;top:10px;left:10px;'></div>" ).appendTo( overflowed ).resizable( { handles: "all" } ),
180180
handle = ".ui-resizable-e",
181-
handlePosition = $(handle).position().left;
181+
handlePosition = $( handle ).position().left;
182182

183183
container.scrollLeft( 100 ).scrollTop( 100 );
184184

185185
position = el.position();
186-
left = el.css("left");
187-
top = el.css("top");
186+
left = el.css( "left" );
187+
top = el.css( "top" );
188188

189-
testHelper.drag(handle, 50, 50);
189+
testHelper.drag( handle, 50, 50 );
190190
deepEqual( el.position(), position, "position stays the same when resized" );
191-
equal( el.css("left"), left, "css('left') stays the same when resized" );
192-
equal( el.css("top"), top, "css('top') stays the same when resized" );
193-
equal( $(handle).position().left, handlePosition + 50, "handle also moved" );
194-
});
191+
equal( el.css( "left" ), left, "css('left') stays the same when resized" );
192+
equal( el.css( "top" ), top, "css('top') stays the same when resized" );
193+
equal( $( handle ).position().left, handlePosition + 50, "handle also moved" );
194+
} );
195195

196196
test( "resizable stores correct size when using helper and grid (#9547)", function() {
197197
expect( 2 );
198198

199199
var handle = ".ui-resizable-se",
200-
target = $( "#resizable1" ).resizable({
200+
target = $( "#resizable1" ).resizable( {
201201
handles: "all",
202202
helper: "ui-resizable-helper",
203203
grid: [ 10, 10 ]
204-
});
204+
} );
205205

206206
testHelper.drag( handle, 1, 1 );
207207
equal( target.width(), 100, "compare width" );
208208
equal( target.height(), 100, "compare height" );
209-
});
209+
} );
210210

211211
test( "nested resizable", function() {
212212
expect( 4 );
@@ -220,9 +220,9 @@ test( "nested resizable", function() {
220220
outer.appendTo( target );
221221
inner.appendTo( outer );
222222

223-
inner.resizable( { handles : "e" } );
224-
outer.resizable( { handles : "e" } );
225-
target.resizable( { handles : "e" } );
223+
inner.resizable( { handles: "e" } );
224+
outer.resizable( { handles: "e" } );
225+
target.resizable( { handles: "e" } );
226226

227227
innerHandle = $( "#inner > .ui-resizable-e" );
228228
outerHandle = $( "#outer > .ui-resizable-e" );
@@ -239,6 +239,6 @@ test( "nested resizable", function() {
239239

240240
inner.remove();
241241
outer.remove();
242-
});
242+
} );
243243

244244
} );

0 commit comments

Comments
 (0)