Formatting

edit
Guillaume Turri 2013-08-11 16:34:04 +02:00
parent 644ae56f4f
commit 48f5ba9367
1 changed files with 15 additions and 13 deletions

View File

@ -193,24 +193,24 @@ var Reveal = (function(){
dom.slides = document.querySelector( '.reveal .slides' ); dom.slides = document.querySelector( '.reveal .slides' );
// Background element // Background element
dom.background = createSingletonNode(dom.wrapper, 'div', 'backgrounds', null); dom.background = createSingletonNode( dom.wrapper, 'div', 'backgrounds', null );
// Progress bar // Progress bar
dom.progress = createSingletonNode(dom.wrapper, 'div', 'progress', '<span></span>'); dom.progress = createSingletonNode( dom.wrapper, 'div', 'progress', '<span></span>' );
dom.progressbar = dom.progress.querySelector('span'); dom.progressbar = dom.progress.querySelector( 'span' );
// Arrow controls // Arrow controls
createSingletonNode(dom.wrapper, 'aside', 'controls', createSingletonNode( dom.wrapper, 'aside', 'controls',
'<div class="navigate-left"></div>' + '<div class="navigate-left"></div>' +
'<div class="navigate-right"></div>' + '<div class="navigate-right"></div>' +
'<div class="navigate-up"></div>' + '<div class="navigate-up"></div>' +
'<div class="navigate-down"></div>'); '<div class="navigate-down"></div>' );
// State background element [DEPRECATED] // State background element [DEPRECATED]
createSingletonNode(dom.wrapper, 'div', 'state-background', null); createSingletonNode( dom.wrapper, 'div', 'state-background', null );
// Overlay graphic which is displayed during the paused mode // Overlay graphic which is displayed during the paused mode
createSingletonNode(dom.wrapper, 'div', 'pause-overlay', null); createSingletonNode( dom.wrapper, 'div', 'pause-overlay', null );
// Cache references to elements // Cache references to elements
if ( config.controls ) { if ( config.controls ) {
@ -227,17 +227,19 @@ var Reveal = (function(){
} }
function createSingletonNode(container, tagname, classname, innerHTML){ function createSingletonNode( container, tagname, classname, innerHTML ){
var node = container.querySelector('.' + classname);
var node = container.querySelector( '.' + classname );
if( !node ){ if( !node ){
node = document.createElement(tagname); node = document.createElement( tagname );
node.classList.add(classname); node.classList.add( classname );
if(innerHTML !== null){ if( innerHTML !== null ){
node.innerHTML = innerHTML; node.innerHTML = innerHTML;
} }
container.appendChild(node); container.appendChild( node );
} }
return node; return node;
} }
/** /**