|
@@ -50,11 +50,19 @@ export default class AutoAnimate {
|
|
// Flag the navigation direction, needed for fragment buildup
|
|
// Flag the navigation direction, needed for fragment buildup
|
|
animationOptions.slideDirection = toSlideIndex > fromSlideIndex ? 'forward' : 'backward';
|
|
animationOptions.slideDirection = toSlideIndex > fromSlideIndex ? 'forward' : 'backward';
|
|
|
|
|
|
|
|
+ // If the from-slide is hidden because it has moved outside
|
|
|
|
+ // the view distance, we need to temporarily show it while
|
|
|
|
+ // measuring
|
|
|
|
+ let fromSlideIsHidden = fromSlide.style.display === 'none';
|
|
|
|
+ if( fromSlideIsHidden ) fromSlide.style.display = this.Reveal.getConfig().display;
|
|
|
|
+
|
|
// Inject our auto-animate styles for this transition
|
|
// Inject our auto-animate styles for this transition
|
|
let css = this.getAutoAnimatableElements( fromSlide, toSlide ).map( elements => {
|
|
let css = this.getAutoAnimatableElements( fromSlide, toSlide ).map( elements => {
|
|
return this.autoAnimateElements( elements.from, elements.to, elements.options || {}, animationOptions, autoAnimateCounter++ );
|
|
return this.autoAnimateElements( elements.from, elements.to, elements.options || {}, animationOptions, autoAnimateCounter++ );
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
+ if( fromSlideIsHidden ) fromSlide.style.display = 'none';
|
|
|
|
+
|
|
// Animate unmatched elements, if enabled
|
|
// Animate unmatched elements, if enabled
|
|
if( toSlide.dataset.autoAnimateUnmatched !== 'false' && this.Reveal.getConfig().autoAnimateUnmatched === true ) {
|
|
if( toSlide.dataset.autoAnimateUnmatched !== 'false' && this.Reveal.getConfig().autoAnimateUnmatched === true ) {
|
|
|
|
|