@@ -1191,45 +1191,45 @@ test("animate with per-property easing", function(){
11911191test ( "animate with CSS shorthand properties" , function ( ) {
11921192 expect ( 11 ) ;
11931193
1194- var _default_count = 0 ,
1195- _special_count = 0 ,
1194+ var easeAnimation_count = 0 ,
1195+ easeProperty_count = 0 ,
11961196 propsBasic = { "padding" : "10 20 30" } ,
1197- propsSpecial = { "padding" : [ "1 2 3" , "_special " ] } ;
1197+ propsSpecial = { "padding" : [ "1 2 3" , "propertyScope " ] } ;
11981198
1199- jQuery . easing . _default = function ( p ) {
1199+ jQuery . easing . animationScope = function ( p ) {
12001200 if ( p >= 1 ) {
1201- _default_count ++ ;
1201+ easeAnimation_count ++ ;
12021202 }
12031203 return p ;
12041204 } ;
12051205
1206- jQuery . easing . _special = function ( p ) {
1206+ jQuery . easing . propertyScope = function ( p ) {
12071207 if ( p >= 1 ) {
1208- _special_count ++ ;
1208+ easeProperty_count ++ ;
12091209 }
12101210 return p ;
12111211 } ;
12121212
12131213 jQuery ( "#foo" )
1214- . animate ( propsBasic , 200 , "_default " , function ( ) {
1214+ . animate ( propsBasic , 200 , "animationScope " , function ( ) {
12151215 equal ( this . style . paddingTop , "10px" , "padding-top was animated" ) ;
12161216 equal ( this . style . paddingLeft , "20px" , "padding-left was animated" ) ;
12171217 equal ( this . style . paddingRight , "20px" , "padding-right was animated" ) ;
12181218 equal ( this . style . paddingBottom , "30px" , "padding-bottom was animated" ) ;
1219- equal ( _default_count , 4 , "per-animation default easing called for each property" ) ;
1220- _default_count = 0 ;
1219+ equal ( easeAnimation_count , 4 , "per-animation default easing called for each property" ) ;
1220+ easeAnimation_count = 0 ;
12211221 } )
1222- . animate ( propsSpecial , 200 , "_default " , function ( ) {
1222+ . animate ( propsSpecial , 200 , "animationScope " , function ( ) {
12231223 equal ( this . style . paddingTop , "1px" , "padding-top was animated again" ) ;
12241224 equal ( this . style . paddingLeft , "2px" , "padding-left was animated again" ) ;
12251225 equal ( this . style . paddingRight , "2px" , "padding-right was animated again" ) ;
12261226 equal ( this . style . paddingBottom , "3px" , "padding-bottom was animated again" ) ;
1227- equal ( _default_count , 0 , "per-animation default easing not called" ) ;
1228- equal ( _special_count , 4 , "special easing called for each property" ) ;
1227+ equal ( easeAnimation_count , 0 , "per-animation default easing not called" ) ;
1228+ equal ( easeProperty_count , 4 , "special easing called for each property" ) ;
12291229
12301230 jQuery ( this ) . css ( "padding" , "0" ) ;
1231- delete jQuery . easing . _default ;
1232- delete jQuery . easing . _special ;
1231+ delete jQuery . easing . animationScope ;
1232+ delete jQuery . easing . propertyScope ;
12331233 } ) ;
12341234 this . clock . tick ( 400 ) ;
12351235} ) ;
@@ -2227,5 +2227,25 @@ test( "Animation should go to its end state if document.hidden = true", 1, funct
22272227 }
22282228} ) ;
22292229
2230+ test ( "jQuery.easing._default (#2218)" , 2 , function ( ) {
2231+ jQuery ( "#foo" )
2232+ . animate ( { width : "5px" } , {
2233+ duration : 5 ,
2234+ start : function ( anim ) {
2235+ equal ( anim . opts . easing , jQuery . easing . _default ,
2236+ "anim.opts.easing should be equal to jQuery.easing._default when the easing argument is not given" ) ;
2237+ }
2238+ } )
2239+ . animate ( { height : "5px" } , {
2240+ duration : 5 ,
2241+ easing : "linear" ,
2242+ start : function ( anim ) {
2243+ equal ( anim . opts . easing , "linear" ,
2244+ "anim.opts.easing should be equal to the easing argument" ) ;
2245+ }
2246+ } )
2247+ . stop ( ) ;
2248+ this . clock . tick ( 25 ) ;
2249+ } ) ;
22302250
22312251} ) ( ) ;
0 commit comments