"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "js/controllers/autoanimate.js" between
reveal.js-4.1.1.tar.gz and reveal.js-4.1.2.tar.gz

About: reveal.js is a HTML presentation framework including nested slides, Markdown contents, PDF export, speaker notes and a JavaScript API.

autoanimate.js  (reveal.js-4.1.1):autoanimate.js  (reveal.js-4.1.2)
skipping to change at line 30 skipping to change at line 30
* Runs an auto-animation between the given slides. * Runs an auto-animation between the given slides.
* *
* @param {HTMLElement} fromSlide * @param {HTMLElement} fromSlide
* @param {HTMLElement} toSlide * @param {HTMLElement} toSlide
*/ */
run( fromSlide, toSlide ) { run( fromSlide, toSlide ) {
// Clean up after prior animations // Clean up after prior animations
this.reset(); this.reset();
// Ensure that both slides are auto-animate targets let allSlides = this.Reveal.getSlides();
if( fromSlide.hasAttribute( 'data-auto-animate' ) && toSlide.hasA let toSlideIndex = allSlides.indexOf( toSlide );
ttribute( 'data-auto-animate' ) ) { let fromSlideIndex = allSlides.indexOf( fromSlide );
// Ensure that both slides are auto-animate targets with the same
data-auto-animate-id value
// (including null if absent on both) and that data-auto-animate-
restart isn't set on the
// physically latter slide (independent of slide direction)
if( fromSlide.hasAttribute( 'data-auto-animate' ) && toSlide.hasA
ttribute( 'data-auto-animate' )
&& fromSlide.getAttribute( 'data-auto-animate-id'
) === toSlide.getAttribute( 'data-auto-animate-id' )
&& !( toSlideIndex > fromSlideIndex ? toSlide : f
romSlide ).hasAttribute( 'data-auto-animate-restart' ) ) {
// Create a new auto-animate sheet // Create a new auto-animate sheet
this.autoAnimateStyleSheet = this.autoAnimateStyleSheet | | createStyleSheet(); this.autoAnimateStyleSheet = this.autoAnimateStyleSheet | | createStyleSheet();
let animationOptions = this.getAutoAnimateOptions( toSlid e ); let animationOptions = this.getAutoAnimateOptions( toSlid e );
// Set our starting state // Set our starting state
fromSlide.dataset.autoAnimate = 'pending'; fromSlide.dataset.autoAnimate = 'pending';
toSlide.dataset.autoAnimate = 'pending'; toSlide.dataset.autoAnimate = 'pending';
// Flag the navigation direction, needed for fragment bui ldup // Flag the navigation direction, needed for fragment bui ldup
let allSlides = this.Reveal.getSlides(); animationOptions.slideDirection = toSlideIndex > fromSlid
animationOptions.slideDirection = allSlides.indexOf( toSl eIndex ? 'forward' : 'backward';
ide ) > allSlides.indexOf( fromSlide ) ? 'forward' : 'backward';
// Inject our auto-animate styles for this transition // Inject our auto-animate styles for this transition
let css = this.getAutoAnimatableElements( fromSlide, toSl ide ).map( elements => { let css = this.getAutoAnimatableElements( fromSlide, toSl ide ).map( elements => {
return this.autoAnimateElements( elements.from, e lements.to, elements.options || {}, animationOptions, autoAnimateCounter++ ); return this.autoAnimateElements( elements.from, e lements.to, elements.options || {}, animationOptions, autoAnimateCounter++ );
} ); } );
// Animate unmatched elements, if enabled // Animate unmatched elements, if enabled
if( toSlide.dataset.autoAnimateUnmatched !== 'false' && t his.Reveal.getConfig().autoAnimateUnmatched === true ) { if( toSlide.dataset.autoAnimateUnmatched !== 'false' && t his.Reveal.getConfig().autoAnimateUnmatched === true ) {
// Our default timings for unmatched elements // Our default timings for unmatched elements
 End of changes. 2 change blocks. 
6 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)