docs/source/_static/presentations/js/reveal.js
/**
	 * Applies JavaScript-controlled layout rules to the
	 * presentation.
	 */
Applies JavaScript-controlled layout rules to the
presentation.
Applies JavaScript - controlled layout rules to the presentation .
function layout() {
		if( dom.wrapper && !isPrintingPDF() ) {
			var availableWidth = dom.wrapper.offsetWidth,
				availableHeight = dom.wrapper.offsetHeight;
			availableWidth -= ( availableHeight * config.margin );
			availableHeight -= ( availableHeight * config.margin );
			var slideWidth = config.width,
				slideHeight = config.height,
				slidePadding = 20; 
			layoutSlideContents( config.width, config.height, slidePadding );
			if( typeof slideWidth === 'string' && /%$/.test( slideWidth ) ) {
				slideWidth = parseInt( slideWidth, 10 ) / 100 * availableWidth;
			}
			if( typeof slideHeight === 'string' && /%$/.test( slideHeight ) ) {
				slideHeight = parseInt( slideHeight, 10 ) / 100 * availableHeight;
			}
			dom.slides.style.width = slideWidth + 'px';
			dom.slides.style.height = slideHeight + 'px';
			scale = Math.min( availableWidth / slideWidth, availableHeight / slideHeight );
			scale = Math.max( scale, config.minScale );
			scale = Math.min( scale, config.maxScale );
			if( typeof dom.slides.style.zoom !== 'undefined' && !navigator.userAgent.match( /(iphone|ipod|ipad|android)/gi ) ) {
				dom.slides.style.zoom = scale;
			}
			else {
				transformElement( dom.slides, 'translate(-50%, -50%) scale('+ scale +') translate(50%, 50%)' );
			}
			var slides = toArray( document.querySelectorAll( SLIDES_SELECTOR ) );
			for( var i = 0, len = slides.length; i < len; i++ ) {
				var slide = slides[ i ];
				if( slide.style.display === 'none' ) {
					continue;
				}
				if( config.center || slide.classList.contains( 'center' ) ) {
					if( slide.classList.contains( 'stack' ) ) {
						slide.style.top = 0;
					}
					else {
						slide.style.top = Math.max( - ( getAbsoluteHeight( slide ) / 2 ) - slidePadding, -slideHeight / 2 ) + 'px';
					}
				}
				else {
					slide.style.top = '';
				}
			}
			updateProgress();
			updateParallax();
		}
	}
function layout ( ) { if ( dom . wrapper && ! isPrintingPDF ( ) ) { var availableWidth = dom . wrapper . offsetWidth , availableHeight = dom . wrapper . offsetHeight ; availableWidth -= ( availableHeight * config . margin ) ; availableHeight -= ( availableHeight * config . margin ) ; var slideWidth = config . width , slideHeight = config . height , slidePadding = 20 ; layoutSlideContents ( config . width , config . height , slidePadding ) ; if ( typeof slideWidth === 'string' && / %$ / . test ( slideWidth ) ) { slideWidth = parseInt ( slideWidth , 10 ) / 100 * availableWidth ; } if ( typeof slideHeight === 'string' && / %$ / . test ( slideHeight ) ) { slideHeight = parseInt ( slideHeight , 10 ) / 100 * availableHeight ; } dom . slides . style . width = slideWidth + 'px' ; dom . slides . style . height = slideHeight + 'px' ; scale = Math . min ( availableWidth / slideWidth , availableHeight / slideHeight ) ; scale = Math . max ( scale , config . minScale ) ; scale = Math . min ( scale , config . maxScale ) ; if ( typeof dom . slides . style . zoom !== 'undefined' && ! navigator . userAgent . match ( / (iphone|ipod|ipad|android) / gi ) ) { dom . slides . style . zoom = scale ; } else { transformElement ( dom . slides , 'translate(-50%, -50%) scale(' + scale + ') translate(50%, 50%)' ) ; } var slides = toArray ( document . querySelectorAll ( SLIDES_SELECTOR ) ) ; for ( var i = 0 , len = slides . length ; i < len ; i ++ ) { var slide = slides [ i ] ; if ( slide . style . display === 'none' ) { continue ; } if ( config . center || slide . classList . contains ( 'center' ) ) { if ( slide . classList . contains ( 'stack' ) ) { slide . style . top = 0 ; } else { slide . style . top = Math . max ( - ( getAbsoluteHeight ( slide ) / 2 ) - slidePadding , - slideHeight / 2 ) + 'px' ; } } else { slide . style . top = '' ; } } updateProgress ( ) ; updateParallax ( ) ; } }
Applies JavaScript-controlled layout rules to the
 presentation.
Applies JavaScript - controlled layout rules to the presentation .
// Available space to scale within // Reduce available space by margin // Dimensions of the content // TODO Dig this out of DOM // Layout the contents of the slides // Slide width may be a percentage of available width // Slide height may be a percentage of available height // Determine scale of content to fit within available space // Respect max/min scale settings // Prefer applying scale via zoom since Chrome blurs scaled content // with nested transforms // Apply scale transform as a fallback // Select all slides, vertical and horizontal // Don't bother updating invisible slides // Vertical stacks are not centred since their section // children will be