Skip to content
Snippets Groups Projects
Commit ac3f021a authored by Hakim El Hattab's avatar Hakim El Hattab
Browse files

add initial slide dom setup pass

parent 6c0dc635
No related branches found
No related tags found
No related merge requests found
...@@ -209,6 +209,26 @@ var Reveal = (function(){ ...@@ -209,6 +209,26 @@ var Reveal = (function(){
} }
/**
* Iterates through and decorates slides DOM elements with
* appropriate classes.
*/
function setupSlides() {
var horizontalSlides = toArray( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );
horizontalSlides.forEach( function( horizontalSlide ) {
var verticalSlides = toArray( horizontalSlide.querySelectorAll( 'section' ) );
verticalSlides.forEach( function( verticalSlide, y ) {
if( y > 0 ) verticalSlide.classList.add( 'future' );
} );
} );
}
/** /**
* Finds and stores references to DOM elements which are * Finds and stores references to DOM elements which are
* required by the presentation. If a required element is * required by the presentation. If a required element is
...@@ -438,6 +458,9 @@ var Reveal = (function(){ ...@@ -438,6 +458,9 @@ var Reveal = (function(){
// Make sure we've got all the DOM elements we need // Make sure we've got all the DOM elements we need
setupDOM(); setupDOM();
// Decorate the slide DOM elements with state classes (past/future)
setupSlides();
// Updates the presentation to match the current configuration values // Updates the presentation to match the current configuration values
configure(); configure();
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment