@@ -1178,45 +1178,45 @@ test("animate with per-property easing", function(){
11781178test ( "animate with CSS shorthand properties" , function ( ) {
11791179 expect ( 11 ) ;
11801180
1181- var _default_count = 0 ,
1182- _special_count = 0 ,
1181+ var easeAnimation_count = 0 ,
1182+ easeProperty_count = 0 ,
11831183 propsBasic = { "padding" : "10 20 30" } ,
1184- propsSpecial = { "padding" : [ "1 2 3" , "_special " ] } ;
1184+ propsSpecial = { "padding" : [ "1 2 3" , "propertyScope " ] } ;
11851185
1186- jQuery . easing . _default = function ( p ) {
1186+ jQuery . easing . animationScope = function ( p ) {
11871187 if ( p >= 1 ) {
1188- _default_count ++ ;
1188+ easeAnimation_count ++ ;
11891189 }
11901190 return p ;
11911191 } ;
11921192
1193- jQuery . easing . _special = function ( p ) {
1193+ jQuery . easing . propertyScope = function ( p ) {
11941194 if ( p >= 1 ) {
1195- _special_count ++ ;
1195+ easeProperty_count ++ ;
11961196 }
11971197 return p ;
11981198 } ;
11991199
12001200 jQuery ( "#foo" )
1201- . animate ( propsBasic , 200 , "_default " , function ( ) {
1201+ . animate ( propsBasic , 200 , "animationScope " , function ( ) {
12021202 equal ( this . style . paddingTop , "10px" , "padding-top was animated" ) ;
12031203 equal ( this . style . paddingLeft , "20px" , "padding-left was animated" ) ;
12041204 equal ( this . style . paddingRight , "20px" , "padding-right was animated" ) ;
12051205 equal ( this . style . paddingBottom , "30px" , "padding-bottom was animated" ) ;
1206- equal ( _default_count , 4 , "per-animation default easing called for each property" ) ;
1207- _default_count = 0 ;
1206+ equal ( easeAnimation_count , 4 , "per-animation default easing called for each property" ) ;
1207+ easeAnimation_count = 0 ;
12081208 } )
1209- . animate ( propsSpecial , 200 , "_default " , function ( ) {
1209+ . animate ( propsSpecial , 200 , "animationScope " , function ( ) {
12101210 equal ( this . style . paddingTop , "1px" , "padding-top was animated again" ) ;
12111211 equal ( this . style . paddingLeft , "2px" , "padding-left was animated again" ) ;
12121212 equal ( this . style . paddingRight , "2px" , "padding-right was animated again" ) ;
12131213 equal ( this . style . paddingBottom , "3px" , "padding-bottom was animated again" ) ;
1214- equal ( _default_count , 0 , "per-animation default easing not called" ) ;
1215- equal ( _special_count , 4 , "special easing called for each property" ) ;
1214+ equal ( easeAnimation_count , 0 , "per-animation default easing not called" ) ;
1215+ equal ( easeProperty_count , 4 , "special easing called for each property" ) ;
12161216
12171217 jQuery ( this ) . css ( "padding" , "0" ) ;
1218- delete jQuery . easing . _default ;
1219- delete jQuery . easing . _special ;
1218+ delete jQuery . easing . animationScope ;
1219+ delete jQuery . easing . propertyScope ;
12201220 } ) ;
12211221 this . clock . tick ( 400 ) ;
12221222} ) ;
@@ -2212,5 +2212,25 @@ test( "Animation should go to its end state if document.hidden = true", 1, funct
22122212 }
22132213} ) ;
22142214
2215+ test ( "jQuery.easing._default (#2218)" , 2 , function ( ) {
2216+ jQuery ( "#foo" )
2217+ . animate ( { width : "5px" } , {
2218+ duration : 5 ,
2219+ start : function ( anim ) {
2220+ equal ( anim . opts . easing , jQuery . easing . _default ,
2221+ "anim.opts.easing should be equal to jQuery.easing._default when the easing argument is not given" ) ;
2222+ }
2223+ } )
2224+ . animate ( { height : "5px" } , {
2225+ duration : 5 ,
2226+ easing : "linear" ,
2227+ start : function ( anim ) {
2228+ equal ( anim . opts . easing , "linear" ,
2229+ "anim.opts.easing should be equal to the easing argument" ) ;
2230+ }
2231+ } )
2232+ . stop ( ) ;
2233+ this . clock . tick ( 25 ) ;
2234+ } ) ;
22152235
22162236} ) ( ) ;
0 commit comments