Skip to content

Commit

Permalink
Change progress bar to not handle active page, since active page upda…
Browse files Browse the repository at this point in the history
…tes progress bar through PAGE_PROGRESS events
  • Loading branch information
newmuis committed Oct 19, 2017
1 parent d19c061 commit 0500899
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions extensions/amp-story/0.1/progress-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,13 @@ export class ProgressBar {
setActivePageIndex(pageIndex) {
this.assertValidPageIndex_(pageIndex);
for (let i = 0; i < this.pageCount_; i++) {
if (i <= pageIndex) {
if (i < pageIndex) {
this.updateProgress(i, 1.0);
} else {
} else if (i > pageIndex) {
this.updateProgress(i, 0.0);
} else {
// The active page manages its own progress by firing PAGE_PROGRESS
// events to amp-story. As such, its progress is not set here.
}
}
}
Expand Down

0 comments on commit 0500899

Please sign in to comment.