website/reveal/js/reveal.js
/**
	 * Updates the background elements to reflect the current
	 * slide.
	 *
	 * @param {Boolean} includeAll If true, the backgrounds of
	 * all vertical slides (not just the present) will be updated.
	 */
Updates the background elements to reflect the current
slide.

@param {Boolean} includeAll If true, the backgrounds of
all vertical slides (not just the present) will be updated.
Updates the background elements to reflect the current slide . @param { Boolean } includeAll If true the backgrounds of all vertical slides ( not just the present ) will be updated .
function updateBackground( includeAll ) {
		var currentBackground = null;
		var horizontalPast = config.rtl ? 'future' : 'past',
			horizontalFuture = config.rtl ? 'past' : 'future';
		toArray( dom.background.childNodes ).forEach( function( backgroundh, h ) {
			if( h < indexh ) {
				backgroundh.className = 'slide-background ' + horizontalPast;
			}
			else if ( h > indexh ) {
				backgroundh.className = 'slide-background ' + horizontalFuture;
			}
			else {
				backgroundh.className = 'slide-background present';
				currentBackground = backgroundh;
			}
			if( includeAll || h === indexh ) {
				toArray( backgroundh.childNodes ).forEach( function( backgroundv, v ) {
					if( v < indexv ) {
						backgroundv.className = 'slide-background past';
					}
					else if ( v > indexv ) {
						backgroundv.className = 'slide-background future';
					}
					else {
						backgroundv.className = 'slide-background present';
						if( h === indexh ) currentBackground = backgroundv;
					}
				} );
			}
		} );
		if( currentBackground ) {
			var previousBackgroundHash = previousBackground ? previousBackground.getAttribute( 'data-background-hash' ) : null;
			var currentBackgroundHash = currentBackground.getAttribute( 'data-background-hash' );
			if( currentBackgroundHash && currentBackgroundHash === previousBackgroundHash && currentBackground !== previousBackground ) {
				dom.background.classList.add( 'no-transition' );
			}
			previousBackground = currentBackground;
		}
		setTimeout( function() {
			dom.background.classList.remove( 'no-transition' );
		}, 1 );
	}
function updateBackground ( includeAll ) { var currentBackground = null ; var horizontalPast = config . rtl ? 'future' : 'past' , horizontalFuture = config . rtl ? 'past' : 'future' ; toArray ( dom . background . childNodes ) . forEach ( function ( backgroundh , h ) { if ( h < indexh ) { backgroundh . className = 'slide-background ' + horizontalPast ; } else if ( h > indexh ) { backgroundh . className = 'slide-background ' + horizontalFuture ; } else { backgroundh . className = 'slide-background present' ; currentBackground = backgroundh ; } if ( includeAll || h === indexh ) { toArray ( backgroundh . childNodes ) . forEach ( function ( backgroundv , v ) { if ( v < indexv ) { backgroundv . className = 'slide-background past' ; } else if ( v > indexv ) { backgroundv . className = 'slide-background future' ; } else { backgroundv . className = 'slide-background present' ; if ( h === indexh ) currentBackground = backgroundv ; } } ) ; } } ) ; if ( currentBackground ) { var previousBackgroundHash = previousBackground ? previousBackground . getAttribute ( 'data-background-hash' ) : null ; var currentBackgroundHash = currentBackground . getAttribute ( 'data-background-hash' ) ; if ( currentBackgroundHash && currentBackgroundHash === previousBackgroundHash && currentBackground !== previousBackground ) { dom . background . classList . add ( 'no-transition' ) ; } previousBackground = currentBackground ; } setTimeout ( function ( ) { dom . background . classList . remove ( 'no-transition' ) ; } , 1 ) ; }
Updates the background elements to reflect the current
 slide.
Updates the background elements to reflect the current slide .
// Reverse past/future classes when in RTL mode // Update the classes of all backgrounds to match the // states of their slides (past/present/future) // Store a reference to the current background element // Only if this is the present horizontal and vertical slide // Don't transition between identical backgrounds. This // prevents unwanted flicker. // Allow the first background to apply without transition