Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Replay button
  • Loading branch information
processprocess committed Jan 7, 2022
commit 7f33a23cd98fb6ddcdc9c0e992db74c5f444bd20
17 changes: 9 additions & 8 deletions extensions/amp-story/1.0/pagination-buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,17 @@ class PaginationButton {
if (state === this.state_) {
return;
}
// console.log(state);

this.mutator_.mutateElement(this.element, () => {
this.element.classList.remove(this.state_.className);
this.element.classList.add(state.className);
this.buttonElement_.setAttribute(
'aria-label',
localize(this.win_.document, state.label)
);
this.state_ = state;
});

this.state_ = state;
}

/**
Expand Down Expand Up @@ -230,12 +231,12 @@ export class PaginationButtons {
if (pageIndex < totalPages - 1) {
this.forwardButton_.updateState(ButtonStates.NEXT_PAGE);
} else {
const viewer = Services.viewerForDoc(this.ampStory_.element);
if (viewer.hasCapability('swipe')) {
this.forwardButton_.updateState(ButtonStates.NEXT_STORY);
} else {
this.forwardButton_.updateState(ButtonStates.REPLAY);
}
// const viewer = Services.viewerForDoc(this.ampStory_.element);
// if (viewer.hasCapability('swipe')) {
// this.forwardButton_.updateState(ButtonStates.NEXT_STORY);
// } else {
this.forwardButton_.updateState(ButtonStates.REPLAY);
// }
}
}

Expand Down