Skip to content

Commit

Permalink
leave the progress bar empty if there's < 2 slides
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed Jun 5, 2020
1 parent d272628 commit ac79c7c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/reveal.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.js

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion js/controllers/progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ export default class Progress {
// Update progress if enabled
if( this.Reveal.getConfig().progress && this.bar ) {

this.bar.style.transform = 'scaleX('+ this.Reveal.getProgress() +')';
let scale = this.Reveal.getProgress();

// Don't fill the progress bar if there's only one slide
if( this.Reveal.getTotalSlides() < 2 ) {
scale = 0;
}

this.bar.style.transform = 'scaleX('+ scale +')';

}

Expand Down

0 comments on commit ac79c7c

Please sign in to comment.