From 3c9ea4301e27f366cacd0081d7860b60b8f4330c Mon Sep 17 00:00:00 2001 From: jlukic Date: Wed, 21 Jan 2015 17:44:23 -0500 Subject: [PATCH] Set transition duration to false by default, inherits from CSS --- src/definitions/modules/transition.js | 30 +++++++++++++++------------ 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/definitions/modules/transition.js b/src/definitions/modules/transition.js index 5ebf42cd7..d7b69978a 100644 --- a/src/definitions/modules/transition.js +++ b/src/definitions/modules/transition.js @@ -232,8 +232,7 @@ $.fn.transition = function() { module.remove.hidden(); module.set.display(); $module - .addClass(className.animating) - .addClass(className.transition) + .addClass(className.animating + ' ' + className.transition + ' ' + animation) .addClass(animation) .one(animationEnd + '.complete' + eventNamespace, module.complete) ; @@ -251,15 +250,17 @@ $.fn.transition = function() { : duration ; module.verbose('Setting animation duration', duration); - $module - .css({ - '-webkit-animation-duration': duration, - '-moz-animation-duration': duration, - '-ms-animation-duration': duration, - '-o-animation-duration': duration, - 'animation-duration': duration - }) - ; + if(duration || duration === 0) { + $module + .css({ + '-webkit-animation-duration': duration, + '-moz-animation-duration': duration, + '-ms-animation-duration': duration, + '-o-animation-duration': duration, + 'animation-duration': duration + }) + ; + } }, display: function() { var @@ -472,7 +473,10 @@ $.fn.transition = function() { }, duration: function(duration) { duration = duration || settings.duration; - return (typeof settings.duration === 'string') + if(duration === false) { + duration = $module.css('animation-duration') || 0; + } + return (typeof duration === 'string') ? (duration.indexOf('ms') > -1) ? parseFloat(duration) : parseFloat(duration) * 1000 @@ -889,7 +893,7 @@ $.fn.transition.settings = { // animation duration animation : 'fade', - duration : '500ms', + duration : false, // new animations will occur after previous ones queue : true,