@@ -45,33 +45,33 @@ asyncTest( ".hide() with step", function() {
45
45
step = $ . noop ;
46
46
} ;
47
47
48
- element . hide ( {
48
+ element . hide ( {
49
49
step : function ( ) {
50
50
step ( ) ;
51
51
} ,
52
52
complete : start
53
- } ) ;
54
- } ) ;
53
+ } ) ;
54
+ } ) ;
55
55
56
56
test ( "Immediate Return Conditions" , function ( ) {
57
57
var hidden = $ ( "div.hidden" ) ,
58
58
count = 0 ;
59
59
expect ( 3 ) ;
60
60
hidden . hide ( "blind" , function ( ) {
61
61
equal ( ++ count , 1 , "Hide on hidden returned immediately" ) ;
62
- } ) . show ( ) . show ( "blind" , function ( ) {
62
+ } ) . show ( ) . show ( "blind" , function ( ) {
63
63
equal ( ++ count , 2 , "Show on shown returned immediately" ) ;
64
- } ) ;
64
+ } ) ;
65
65
equal ( ++ count , 3 , "Both Functions worked properly" ) ;
66
- } ) ;
66
+ } ) ;
67
67
68
68
test ( ".hide() with hidden parent" , function ( ) {
69
69
expect ( 1 ) ;
70
70
var element = $ ( "div.hidden" ) . children ( ) ;
71
71
element . hide ( "blind" , function ( ) {
72
72
equal ( element . css ( "display" ) , "none" , "display: none" ) ;
73
- } ) ;
74
- } ) ;
73
+ } ) ;
74
+ } ) ;
75
75
76
76
asyncTest ( "Parse of null for options" , function ( ) {
77
77
var hidden = $ ( "div.hidden" ) ,
@@ -80,8 +80,8 @@ asyncTest( "Parse of null for options", function() {
80
80
hidden . show ( "blind" , null , 1 , function ( ) {
81
81
equal ( ++ count , 1 , "null for options still works" ) ;
82
82
start ( ) ;
83
- } ) ;
84
- } ) ;
83
+ } ) ;
84
+ } ) ;
85
85
86
86
test ( "removeClass" , function ( ) {
87
87
expect ( 3 ) ;
@@ -92,28 +92,28 @@ test( "removeClass", function() {
92
92
equal ( "destroyed" , element [ 0 ] . className ) ;
93
93
element . removeClass ( ) ;
94
94
equal ( "" , element [ 0 ] . className ) ;
95
- } ) ;
95
+ } ) ;
96
96
97
97
module ( "effects.core: animateClass" ) ;
98
98
99
99
asyncTest ( "animateClass works with borderStyle" , function ( ) {
100
- var test = $ ( "div.animateClass" ) ;
101
- expect ( 3 ) ;
102
- test . toggleClass ( "testAddBorder" , minDuration , function ( ) {
103
- test . toggleClass ( "testAddBorder" , minDuration , function ( ) {
104
- equal ( test . css ( "borderLeftStyle" ) , "none" , "None border set" ) ;
100
+ var test = $ ( "div.animateClass" ) ;
101
+ expect ( 3 ) ;
102
+ test . toggleClass ( "testAddBorder" , minDuration , function ( ) {
103
+ test . toggleClass ( "testAddBorder" , minDuration , function ( ) {
104
+ equal ( test . css ( "borderLeftStyle" ) , "none" , "None border set" ) ;
105
105
start ( ) ;
106
- } ) ;
107
- equal ( test . css ( "borderLeftStyle" ) , "solid" , "None border not immedately set" ) ;
108
- } ) ;
109
- equal ( test . css ( "borderLeftStyle" ) , "solid" , "Solid border immedately set" ) ;
110
- } ) ;
106
+ } ) ;
107
+ equal ( test . css ( "borderLeftStyle" ) , "solid" , "None border not immedately set" ) ;
108
+ } ) ;
109
+ equal ( test . css ( "borderLeftStyle" ) , "solid" , "Solid border immedately set" ) ;
110
+ } ) ;
111
111
112
112
asyncTest ( "animateClass works with colors" , function ( ) {
113
- var test = $ ( "div.animateClass" ) ,
113
+ var test = $ ( "div.animateClass" ) ,
114
114
oldStep = jQuery . fx . step . backgroundColor ;
115
115
116
- expect ( 2 ) ;
116
+ expect ( 2 ) ;
117
117
118
118
// We want to catch the first frame of animation
119
119
jQuery . fx . step . backgroundColor = function ( fx ) {
@@ -122,21 +122,21 @@ asyncTest( "animateClass works with colors", function() {
122
122
// Make sure it has animated somewhere we can detect
123
123
if ( fx . pos > 255 / 2000 ) {
124
124
jQuery . fx . step . backgroundColor = oldStep ;
125
- notPresent ( test . css ( "backgroundColor" ) ,
125
+ notPresent ( test . css ( "backgroundColor" ) ,
126
126
[ "#000000" , "#ffffff" , "#000" , "#fff" , "rgb(0, 0, 0)" , "rgb(255,255,255)" ] ,
127
127
"Color is not endpoints in middle." ) ;
128
128
test . stop ( true , true ) ;
129
129
}
130
130
} ;
131
131
132
- test . toggleClass ( "testChangeBackground" , {
132
+ test . toggleClass ( "testChangeBackground" , {
133
133
duration : 2000 ,
134
134
complete : function ( ) {
135
- present ( test . css ( "backgroundColor" ) , [ "#ffffff" , "#fff" , "rgb(255, 255, 255)" ] , "Color is final" ) ;
135
+ present ( test . css ( "backgroundColor" ) , [ "#ffffff" , "#fff" , "rgb(255, 255, 255)" ] , "Color is final" ) ;
136
136
start ( ) ;
137
137
}
138
- } ) ;
139
- } ) ;
138
+ } ) ;
139
+ } ) ;
140
140
141
141
asyncTest ( "animateClass calls step option" , 1 , function ( ) {
142
142
var test = jQuery ( "div.animateClass" ) ,
@@ -150,23 +150,23 @@ asyncTest( "animateClass calls step option", 1, function() {
150
150
step : function ( ) {
151
151
step ( ) ;
152
152
}
153
- } ) ;
154
- } ) ;
153
+ } ) ;
154
+ } ) ;
155
155
156
156
asyncTest ( "animateClass works with children" , 3 , function ( ) {
157
157
var animatedChild ,
158
- test = $ ( "div.animateClass" ) ,
159
- h2 = test . find ( "h2" ) ;
158
+ test = $ ( "div.animateClass" ) ,
159
+ h2 = test . find ( "h2" ) ;
160
160
161
- test . toggleClass ( "testChildren" , {
161
+ test . toggleClass ( "testChildren" , {
162
162
children : true ,
163
163
duration : duration ,
164
164
complete : function ( ) {
165
- equal ( h2 . css ( "fontSize" ) , "20px" , "Text size is final during complete" ) ;
166
- test . toggleClass ( "testChildren" , {
165
+ equal ( h2 . css ( "fontSize" ) , "20px" , "Text size is final during complete" ) ;
166
+ test . toggleClass ( "testChildren" , {
167
167
duration : duration ,
168
168
complete : function ( ) {
169
- equal ( h2 . css ( "fontSize" ) , "10px" , "Text size revertted after class removed" ) ;
169
+ equal ( h2 . css ( "fontSize" ) , "10px" , "Text size revertted after class removed" ) ;
170
170
171
171
start ( ) ;
172
172
} ,
@@ -175,20 +175,20 @@ asyncTest( "animateClass works with children", 3, function() {
175
175
ok ( false , "Error - Animating property on h2" ) ;
176
176
}
177
177
}
178
- } ) ;
178
+ } ) ;
179
179
} ,
180
180
step : function ( val , fx ) {
181
181
if ( fx . prop === "fontSize" && fx . elem === h2 [ 0 ] && ! animatedChild ) {
182
182
equal ( fx . end , 20 , "animating font size on child" ) ;
183
183
animatedChild = true ;
184
184
}
185
185
}
186
- } ) ;
187
- } ) ;
186
+ } ) ;
187
+ } ) ;
188
188
189
189
asyncTest ( "animateClass clears style properties when stopped" , function ( ) {
190
- var test = $ ( "div.animateClass" ) ,
191
- style = test [ 0 ] . style ,
190
+ var test = $ ( "div.animateClass" ) ,
191
+ style = test [ 0 ] . style ,
192
192
orig = style . cssText ;
193
193
194
194
expect ( 2 ) ;
@@ -199,7 +199,7 @@ asyncTest( "animateClass clears style properties when stopped", function() {
199
199
test . stop ( true , true ) ;
200
200
equal ( orig , $ . trim ( style . cssText ) , "cssText is the same after stopping animation midway" ) ;
201
201
start ( ) ;
202
- } ) ;
202
+ } ) ;
203
203
204
204
asyncTest ( "animateClass: css and class changes during animation are not lost (#7106)" ,
205
205
function ( assert ) {
@@ -217,7 +217,7 @@ function( assert ) {
217
217
test . addClass ( "animate" , minDuration , animationComplete )
218
218
. addClass ( "testClass" )
219
219
. height ( 100 ) ;
220
- } ) ;
220
+ } ) ;
221
221
222
222
test ( "createPlaceholder: only created for static or relative elements" , function ( ) {
223
223
expect ( 4 ) ;
@@ -226,16 +226,16 @@ test( "createPlaceholder: only created for static or relative elements", functio
226
226
ok ( $ . effects . createPlaceholder ( $ ( ".static" ) ) . length , "placeholder created for static element" ) ;
227
227
ok ( ! $ . effects . createPlaceholder ( $ ( ".absolute" ) ) , "placeholder not created for absolute element" ) ;
228
228
ok ( ! $ . effects . createPlaceholder ( $ ( ".fixed" ) ) , "placeholder not created for fixed element" ) ;
229
- } ) ;
229
+ } ) ;
230
230
231
231
test ( "createPlaceholder: preserves layout affecting properties" , function ( ) {
232
232
expect ( 7 ) ;
233
233
234
234
var position = 5 ,
235
- element = $ ( ".relative" ) . css ( {
235
+ element = $ ( ".relative" ) . css ( {
236
236
top : position ,
237
237
left : position
238
- } ) ,
238
+ } ) ,
239
239
before = {
240
240
offset : element . offset ( ) ,
241
241
outerWidth : element . outerWidth ( true ) ,
@@ -253,10 +253,10 @@ test( "createPlaceholder: preserves layout affecting properties", function() {
253
253
deepEqual ( before . position . top - position , placeholder . position ( ) . top , "position top preserved" ) ;
254
254
deepEqual ( before . position . left - position , placeholder . position ( ) . left , "position left preserved" ) ;
255
255
256
- deepEqual ( before [ " float" ] , placeholder . css ( "float" ) , "float preserved" ) ;
256
+ deepEqual ( before . float , placeholder . css ( "float" ) , "float preserved" ) ;
257
257
deepEqual ( before . outerWidth , placeholder . outerWidth ( true ) , "width preserved" ) ;
258
258
deepEqual ( before . outerHeight , placeholder . outerHeight ( true ) , "height preserved" ) ;
259
- } ) ;
259
+ } ) ;
260
260
261
261
module ( "transfer" ) ;
262
262
@@ -321,47 +321,47 @@ $.each( $.effects.effect, function( effect ) {
321
321
322
322
hidden
323
323
. queue ( queueTest ( ) )
324
- . queue ( duringTest ( function ( ) {
324
+ . queue ( duringTest ( function ( ) {
325
325
ok ( hidden . is ( ":animated" ) ,
326
326
"Hidden is seen as animated during .show(\"" + effect + "\", time)" ) ;
327
- } ) )
328
- . show ( effect , minDuration , queueTest ( function ( ) {
327
+ } ) )
328
+ . show ( effect , minDuration , queueTest ( function ( ) {
329
329
equal ( hidden . css ( "display" ) , "block" ,
330
330
"Hidden is shown after .show(\"" + effect + "\", time)" ) ;
331
331
ok ( ! $ ( ".ui-effects-placeholder" ) . length ,
332
332
"No placeholder remains after .show(\"" + effect + "\", time)" ) ;
333
- } ) )
333
+ } ) )
334
334
. queue ( queueTest ( ) )
335
- . queue ( duringTest ( function ( ) {
335
+ . queue ( duringTest ( function ( ) {
336
336
ok ( hidden . is ( ":animated" ) ,
337
337
"Hidden is seen as animated during .hide(\"" + effect + "\", time)" ) ;
338
- } ) )
339
- . hide ( effect , minDuration , queueTest ( function ( ) {
338
+ } ) )
339
+ . hide ( effect , minDuration , queueTest ( function ( ) {
340
340
equal ( hidden . css ( "display" ) , "none" ,
341
341
"Back to hidden after .hide(\"" + effect + "\", time)" ) ;
342
342
ok ( ! $ ( ".ui-effects-placeholder" ) . length ,
343
343
"No placeholder remains after .hide(\"" + effect + "\", time)" ) ;
344
- } ) )
345
- . queue ( queueTest ( function ( ) {
344
+ } ) )
345
+ . queue ( queueTest ( function ( ) {
346
346
deepEqual ( hidden . queue ( ) , [ "inprogress" ] , "Only the inprogress sentinel remains" ) ;
347
347
start ( ) ;
348
- } ) ) ;
349
- } ) ;
348
+ } ) ) ;
349
+ } ) ;
350
350
351
351
asyncTest ( "relative width & height - properties are preserved" , function ( ) {
352
- var test = $ ( "div.relWidth.relHeight" ) ,
352
+ var test = $ ( "div.relWidth.relHeight" ) ,
353
353
width = test . width ( ) , height = test . height ( ) ,
354
- cssWidth = test [ 0 ] . style . width , cssHeight = test [ 0 ] . style . height ;
354
+ cssWidth = test [ 0 ] . style . width , cssHeight = test [ 0 ] . style . height ;
355
355
356
356
expect ( 4 ) ;
357
357
test . toggle ( effect , minDuration , function ( ) {
358
- equal ( test [ 0 ] . style . width , cssWidth , "Inline CSS Width has been reset after animation ended" ) ;
359
- equal ( test [ 0 ] . style . height , cssHeight , "Inline CSS Height has been rest after animation ended" ) ;
358
+ equal ( test [ 0 ] . style . width , cssWidth , "Inline CSS Width has been reset after animation ended" ) ;
359
+ equal ( test [ 0 ] . style . height , cssHeight , "Inline CSS Height has been rest after animation ended" ) ;
360
360
start ( ) ;
361
- } ) ;
361
+ } ) ;
362
362
equal ( test . width ( ) , width , "Width is the same px after animation started" ) ;
363
363
equal ( test . height ( ) , height , "Height is the same px after animation started" ) ;
364
- } ) ;
365
- } ) ;
364
+ } ) ;
365
+ } ) ;
366
366
367
367
} ) ;
0 commit comments