aboutsummaryrefslogtreecommitdiffhomepage
path: root/js/reveal.js
diff options
context:
space:
mode:
authorHakim El Hattab2013-11-28 09:35:28 -0500
committerHakim El Hattab2013-11-28 09:35:28 -0500
commit599bef5fdfb70b4a85c95cf62c7eebfa85b6cbd5 (patch)
treee53a8879bdc928dead380043f9d063f9dc53620d /js/reveal.js
parent0eba619c1a66b6fb086464d5f268c0fdb714ed28 (diff)
parentf7b612b1e4a916e5847cdf84be5628bd187a562f (diff)
Merge branch 'dev' of github.com:hakimel/reveal.js
Diffstat (limited to 'js/reveal.js')
-rw-r--r--js/reveal.js36
1 files changed, 29 insertions, 7 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 26ebc48..98d802e 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -316,8 +316,8 @@ var Reveal = (function(){
// Make sure we've got all the DOM elements we need
setupDOM();
- // Decorate the slide DOM elements with state classes (past/future)
- formatSlides();
+ // Resets all vertical slides so that only the first is visible
+ resetVerticalSlides();
// Updates the presentation to match the current configuration values
configure();
@@ -1603,7 +1603,7 @@ var Reveal = (function(){
// Re-create the slide backgrounds
createBackgrounds();
- formatSlides();
+ sortAllFragments();
updateControls();
updateProgress();
@@ -1613,10 +1613,10 @@ var Reveal = (function(){
}
/**
- * Iterates through and decorates slides DOM elements with
- * appropriate classes.
+ * Resets all vertical slides so that only the first
+ * is visible.
*/
- function formatSlides() {
+ function resetVerticalSlides() {
var horizontalSlides = toArray( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );
horizontalSlides.forEach( function( horizontalSlide ) {
@@ -1624,7 +1624,29 @@ var Reveal = (function(){
var verticalSlides = toArray( horizontalSlide.querySelectorAll( 'section' ) );
verticalSlides.forEach( function( verticalSlide, y ) {
- if( y > 0 ) verticalSlide.classList.add( 'future' );
+ if( y > 0 ) {
+ verticalSlide.classList.remove( 'present' );
+ verticalSlide.classList.remove( 'past' );
+ verticalSlide.classList.add( 'future' );
+ }
+
+ } );
+
+ } );
+
+ }
+
+ /**
+ * Sorts and formats all of fragments in the
+ * presentation.
+ */
+ function sortAllFragments() {
+
+ var horizontalSlides = toArray( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );
+ horizontalSlides.forEach( function( horizontalSlide ) {
+
+ var verticalSlides = toArray( horizontalSlide.querySelectorAll( 'section' ) );
+ verticalSlides.forEach( function( verticalSlide, y ) {
sortFragments( verticalSlide.querySelectorAll( '.fragment' ) );