From 4a4a2cb57c22f9212a36992e1c0f1965e316ea2e Mon Sep 17 00:00:00 2001 From: Alexander Schmitz Date: Fri, 14 Feb 2014 17:00:20 -0500 Subject: [PATCH] AnimationComplete: change default to durationDefault fix duration read Safegurard against NAN values and fix camelcase of duration name Fixes gh-7114 Fixes gh-7118 --- js/jquery.mobile.animationComplete.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/jquery.mobile.animationComplete.js b/js/jquery.mobile.animationComplete.js index 66606a01aec..8bf90e5dc99 100644 --- a/js/jquery.mobile.animationComplete.js +++ b/js/jquery.mobile.animationComplete.js @@ -34,7 +34,6 @@ define( [ // All lower case if not a vendor prop if ( props[ test ][ "prefix" ] === "" ) { - props[ test ][ "duration" ] = props[ test ][ "duration" ].toLowerCase(); props[ test ][ "event" ] = props[ test ][ "event" ].toLowerCase(); } }); @@ -64,14 +63,15 @@ define( [ // Parse the durration since its in second multiple by 1000 for milliseconds // Multiply by 3 to make sure we give the animation plenty of time. - duration = parseFloat( - $( this ).css( props[ animationType ].duration ) - ) * 3000; + duration = $( this ).css( props[ animationType ].duration ); + if ( duration !== undefined ) { + duration = parseFloat( duration ) * 3000; + } } // If we could not read a duration use the default if ( duration === 0 || duration === undefined ) { - duration = $.fn.animationComplete.default; + duration = $.fn.animationComplete.defaultDuration; } } @@ -98,7 +98,7 @@ define( [ }; // Allow default callback to be configured on mobileInit - $.fn.animationComplete.default = 1000; + $.fn.animationComplete.defaultDuration = 1000; })( jQuery ); //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); });