Skip to content

Commit

Permalink
ensure that all fragments on past slides are visible #684
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed Nov 7, 2013
1 parent e7e941b commit a119c83
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
13 changes: 10 additions & 3 deletions js/reveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -1699,16 +1699,23 @@ var Reveal = (function(){
if( i < index ) {
// Any element previous to index is given the 'past' class
element.classList.add( reverse ? 'future' : 'past' );

var pastFragments = toArray( element.querySelectorAll( '.fragment' ) );

// Show all fragments on prior slides
while( pastFragments.length ) {
pastFragments.pop().classList.add( 'visible' );
}
}
else if( i > index ) {
// Any element subsequent to index is given the 'future' class
element.classList.add( reverse ? 'past' : 'future' );

var fragments = toArray( element.querySelectorAll( '.fragment.visible' ) );
var futureFragments = toArray( element.querySelectorAll( '.fragment.visible' ) );

// No fragments in future slides should be visible ahead of time
while( fragments.length ) {
fragments.pop().classList.remove( 'visible' );
while( futureFragments.length ) {
futureFragments.pop().classList.remove( 'visible' );
}
}

Expand Down
Loading

0 comments on commit a119c83

Please sign in to comment.