@@ -4,7 +4,7 @@ define( [
4
4
"ui/widgets/resizable"
5
5
] , function ( $ , testHelper ) {
6
6
7
- module ( "resizable: core" ) ;
7
+ module ( "resizable: core" ) ;
8
8
9
9
/*
10
10
test("element types", function() {
@@ -25,188 +25,188 @@ test("element types", function() {
25
25
});
26
26
*/
27
27
28
- test ( "n" , function ( ) {
29
- expect ( 4 ) ;
28
+ test ( "n" , function ( ) {
29
+ expect ( 4 ) ;
30
30
31
- var handle = ".ui-resizable-n" , target = $ ( "#resizable1" ) . resizable ( { handles : "all" } ) ;
31
+ var handle = ".ui-resizable-n" , target = $ ( "#resizable1" ) . resizable ( { handles : "all" } ) ;
32
32
33
- testHelper . drag ( handle , 0 , - 50 ) ;
33
+ testHelper . drag ( handle , 0 , - 50 ) ;
34
34
equal ( target . height ( ) , 150 , "compare height" ) ;
35
35
36
- testHelper . drag ( handle , 0 , 50 ) ;
36
+ testHelper . drag ( handle , 0 , 50 ) ;
37
37
equal ( target . height ( ) , 100 , "compare height" ) ;
38
38
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
+ } ) ;
42
42
43
- test ( "s" , function ( ) {
44
- expect ( 5 ) ;
43
+ test ( "s" , function ( ) {
44
+ expect ( 5 ) ;
45
45
46
- var handle = ".ui-resizable-s" , target = $ ( "#resizable1" ) . resizable ( { handles : "all" } ) ;
46
+ var handle = ".ui-resizable-s" , target = $ ( "#resizable1" ) . resizable ( { handles : "all" } ) ;
47
47
48
- testHelper . drag ( handle , 0 , 50 ) ;
48
+ testHelper . drag ( handle , 0 , 50 ) ;
49
49
equal ( target . height ( ) , 150 , "compare height" ) ;
50
50
51
- testHelper . drag ( handle , 0 , - 50 ) ;
51
+ testHelper . drag ( handle , 0 , - 50 ) ;
52
52
equal ( target . height ( ) , 100 , "compare height" ) ;
53
53
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
+ } ) ;
58
58
59
- test ( "e" , function ( ) {
60
- expect ( 5 ) ;
59
+ test ( "e" , function ( ) {
60
+ expect ( 5 ) ;
61
61
62
- var handle = ".ui-resizable-e" , target = $ ( "#resizable1" ) . resizable ( { handles : "all" } ) ;
62
+ var handle = ".ui-resizable-e" , target = $ ( "#resizable1" ) . resizable ( { handles : "all" } ) ;
63
63
64
- testHelper . drag ( handle , 50 ) ;
65
- equal ( target . width ( ) , 150 , "compare width" ) ;
64
+ testHelper . drag ( handle , 50 ) ;
65
+ equal ( target . width ( ) , 150 , "compare width" ) ;
66
66
67
- testHelper . drag ( handle , - 50 ) ;
67
+ testHelper . drag ( handle , - 50 ) ;
68
68
equal ( target . width ( ) , 100 , "compare width" ) ;
69
69
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
+ } ) ;
74
74
75
- test ( "w" , function ( ) {
76
- expect ( 4 ) ;
75
+ test ( "w" , function ( ) {
76
+ expect ( 4 ) ;
77
77
78
- var handle = ".ui-resizable-w" , target = $ ( "#resizable1" ) . resizable ( { handles : "all" } ) ;
78
+ var handle = ".ui-resizable-w" , target = $ ( "#resizable1" ) . resizable ( { handles : "all" } ) ;
79
79
80
- testHelper . drag ( handle , - 50 ) ;
80
+ testHelper . drag ( handle , - 50 ) ;
81
81
equal ( target . width ( ) , 150 , "compare width" ) ;
82
82
83
- testHelper . drag ( handle , 50 ) ;
83
+ testHelper . drag ( handle , 50 ) ;
84
84
equal ( target . width ( ) , 100 , "compare width" ) ;
85
85
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
+ } ) ;
89
89
90
- test ( "ne" , function ( ) {
91
- expect ( 5 ) ;
90
+ test ( "ne" , function ( ) {
91
+ expect ( 5 ) ;
92
92
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" } ) ;
94
94
95
- testHelper . drag ( handle , - 50 , - 50 ) ;
95
+ testHelper . drag ( handle , - 50 , - 50 ) ;
96
96
equal ( target . width ( ) , 50 , "compare width" ) ;
97
97
equal ( target . height ( ) , 150 , "compare height" ) ;
98
98
99
- testHelper . drag ( handle , 50 , 50 ) ;
99
+ testHelper . drag ( handle , 50 , 50 ) ;
100
100
equal ( target . width ( ) , 100 , "compare width" ) ;
101
101
equal ( target . height ( ) , 100 , "compare height" ) ;
102
102
103
- equal ( target [ 0 ] . style . left , "" , "left should not be modified" ) ;
104
- } ) ;
103
+ equal ( target [ 0 ] . style . left , "" , "left should not be modified" ) ;
104
+ } ) ;
105
105
106
- test ( "se" , function ( ) {
107
- expect ( 6 ) ;
106
+ test ( "se" , function ( ) {
107
+ expect ( 6 ) ;
108
108
109
- var handle = ".ui-resizable-se" , target = $ ( "#resizable1" ) . resizable ( { handles : "all" } ) ;
109
+ var handle = ".ui-resizable-se" , target = $ ( "#resizable1" ) . resizable ( { handles : "all" } ) ;
110
110
111
- testHelper . drag ( handle , 50 , 50 ) ;
111
+ testHelper . drag ( handle , 50 , 50 ) ;
112
112
equal ( target . width ( ) , 150 , "compare width" ) ;
113
113
equal ( target . height ( ) , 150 , "compare height" ) ;
114
114
115
- testHelper . drag ( handle , - 50 , - 50 ) ;
115
+ testHelper . drag ( handle , - 50 , - 50 ) ;
116
116
equal ( target . width ( ) , 100 , "compare width" ) ;
117
117
equal ( target . height ( ) , 100 , "compare height" ) ;
118
118
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
+ } ) ;
122
122
123
- test ( "sw" , function ( ) {
124
- expect ( 5 ) ;
123
+ test ( "sw" , function ( ) {
124
+ expect ( 5 ) ;
125
125
126
- var handle = ".ui-resizable-sw" , target = $ ( "#resizable1" ) . resizable ( { handles : "all" } ) ;
126
+ var handle = ".ui-resizable-sw" , target = $ ( "#resizable1" ) . resizable ( { handles : "all" } ) ;
127
127
128
- testHelper . drag ( handle , - 50 , - 50 ) ;
128
+ testHelper . drag ( handle , - 50 , - 50 ) ;
129
129
equal ( target . width ( ) , 150 , "compare width" ) ;
130
130
equal ( target . height ( ) , 50 , "compare height" ) ;
131
131
132
- testHelper . drag ( handle , 50 , 50 ) ;
132
+ testHelper . drag ( handle , 50 , 50 ) ;
133
133
equal ( target . width ( ) , 100 , "compare width" ) ;
134
134
equal ( target . height ( ) , 100 , "compare height" ) ;
135
135
136
- equal ( target [ 0 ] . style . top , "" , "top should not be modified" ) ;
137
- } ) ;
136
+ equal ( target [ 0 ] . style . top , "" , "top should not be modified" ) ;
137
+ } ) ;
138
138
139
- test ( "nw" , function ( ) {
140
- expect ( 4 ) ;
139
+ test ( "nw" , function ( ) {
140
+ expect ( 4 ) ;
141
141
142
- var handle = ".ui-resizable-nw" , target = $ ( "#resizable1" ) . resizable ( { handles : "all" } ) ;
142
+ var handle = ".ui-resizable-nw" , target = $ ( "#resizable1" ) . resizable ( { handles : "all" } ) ;
143
143
144
- testHelper . drag ( handle , - 50 , - 50 ) ;
144
+ testHelper . drag ( handle , - 50 , - 50 ) ;
145
145
equal ( target . width ( ) , 150 , "compare width" ) ;
146
146
equal ( target . height ( ) , 150 , "compare height" ) ;
147
147
148
- testHelper . drag ( handle , 50 , 50 ) ;
148
+ testHelper . drag ( handle , 50 , 50 ) ;
149
149
equal ( target . width ( ) , 100 , "compare width" ) ;
150
150
equal ( target . height ( ) , 100 , "compare height" ) ;
151
- } ) ;
151
+ } ) ;
152
152
153
- test ( "handle with complex markup (#8756)" , function ( ) {
154
- expect ( 2 ) ;
153
+ test ( "handle with complex markup (#8756)" , function ( ) {
154
+ expect ( 2 ) ;
155
155
156
- $ ( "#resizable1" )
156
+ $ ( "#resizable1" )
157
157
. 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>" ) )
162
162
) ;
163
163
164
- var handle = ".ui-resizable-w div" , target = $ ( "#resizable1" ) . resizable ( { handles : "all" } ) ;
164
+ var handle = ".ui-resizable-w div" , target = $ ( "#resizable1" ) . resizable ( { handles : "all" } ) ;
165
165
166
- testHelper . drag ( handle , - 50 ) ;
166
+ testHelper . drag ( handle , - 50 ) ;
167
167
equal ( target . width ( ) , 150 , "compare width" ) ;
168
168
169
- testHelper . drag ( handle , 50 ) ;
169
+ testHelper . drag ( handle , 50 ) ;
170
170
equal ( target . width ( ) , 100 , "compare width" ) ;
171
- } ) ;
171
+ } ) ;
172
172
173
- test ( "resizable accounts for scroll position correctly (#3815)" , function ( ) {
173
+ test ( "resizable accounts for scroll position correctly (#3815)" , function ( ) {
174
174
expect ( 4 ) ;
175
175
176
176
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" } ) ,
180
180
handle = ".ui-resizable-e" ,
181
- handlePosition = $ ( handle ) . position ( ) . left ;
181
+ handlePosition = $ ( handle ) . position ( ) . left ;
182
182
183
183
container . scrollLeft ( 100 ) . scrollTop ( 100 ) ;
184
184
185
185
position = el . position ( ) ;
186
- left = el . css ( "left" ) ;
187
- top = el . css ( "top" ) ;
186
+ left = el . css ( "left" ) ;
187
+ top = el . css ( "top" ) ;
188
188
189
- testHelper . drag ( handle , 50 , 50 ) ;
189
+ testHelper . drag ( handle , 50 , 50 ) ;
190
190
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
+ } ) ;
195
195
196
196
test ( "resizable stores correct size when using helper and grid (#9547)" , function ( ) {
197
197
expect ( 2 ) ;
198
198
199
199
var handle = ".ui-resizable-se" ,
200
- target = $ ( "#resizable1" ) . resizable ( {
200
+ target = $ ( "#resizable1" ) . resizable ( {
201
201
handles : "all" ,
202
202
helper : "ui-resizable-helper" ,
203
203
grid : [ 10 , 10 ]
204
- } ) ;
204
+ } ) ;
205
205
206
206
testHelper . drag ( handle , 1 , 1 ) ;
207
207
equal ( target . width ( ) , 100 , "compare width" ) ;
208
208
equal ( target . height ( ) , 100 , "compare height" ) ;
209
- } ) ;
209
+ } ) ;
210
210
211
211
test ( "nested resizable" , function ( ) {
212
212
expect ( 4 ) ;
@@ -220,9 +220,9 @@ test( "nested resizable", function() {
220
220
outer . appendTo ( target ) ;
221
221
inner . appendTo ( outer ) ;
222
222
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" } ) ;
226
226
227
227
innerHandle = $ ( "#inner > .ui-resizable-e" ) ;
228
228
outerHandle = $ ( "#outer > .ui-resizable-e" ) ;
@@ -239,6 +239,6 @@ test( "nested resizable", function() {
239
239
240
240
inner . remove ( ) ;
241
241
outer . remove ( ) ;
242
- } ) ;
242
+ } ) ;
243
243
244
244
} ) ;
0 commit comments