allow custom auto-animate matchers to override transition settings
parent
1c62b808ad
commit
55aab24a5e
18
js/reveal.js
18
js/reveal.js
|
@ -3854,12 +3854,14 @@
|
||||||
delete element.dataset.autoAnimateTarget;
|
delete element.dataset.autoAnimateTarget;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
var animationOptions = getAutoAnimateOptions( toSlide );
|
var animationOptions = getAutoAnimateOptions( toSlide, {
|
||||||
|
|
||||||
// If our slides are centered vertically, we need to
|
// If our slides are centered vertically, we need to
|
||||||
// account for their difference in position when
|
// account for their difference in position when
|
||||||
// calculating deltas for animated elements
|
// calculating deltas for animated elements
|
||||||
if( config.center ) animationOptions.offsetY = fromSlide.offsetTop - toSlide.offsetTop;
|
offsetY: config.center ? fromSlide.offsetTop - toSlide.offsetTop : 0
|
||||||
|
|
||||||
|
} );
|
||||||
|
|
||||||
// Set our starting state
|
// Set our starting state
|
||||||
fromSlide.dataset.autoAnimate = 'pending';
|
fromSlide.dataset.autoAnimate = 'pending';
|
||||||
|
@ -3933,6 +3935,12 @@
|
||||||
// like transition easing, duration and delay
|
// like transition easing, duration and delay
|
||||||
animationOptions = getAutoAnimateOptions( to, animationOptions );
|
animationOptions = getAutoAnimateOptions( to, animationOptions );
|
||||||
|
|
||||||
|
// Individual transition settings can be overridden via
|
||||||
|
// element options
|
||||||
|
if( typeof elementOptions.delay !== 'undefined' ) animationOptions.delay = elementOptions.delay;
|
||||||
|
if( typeof elementOptions.duration !== 'undefined' ) animationOptions.duration = elementOptions.duration;
|
||||||
|
if( typeof elementOptions.easing !== 'undefined' ) animationOptions.easing = elementOptions.easing;
|
||||||
|
|
||||||
var fromProps = getAutoAnimatableProperties( 'from', from, elementOptions ),
|
var fromProps = getAutoAnimatableProperties( 'from', from, elementOptions ),
|
||||||
toProps = getAutoAnimatableProperties( 'to', to, elementOptions );
|
toProps = getAutoAnimatableProperties( 'to', to, elementOptions );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue