Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [amp-story] Build pagination buttons for pre-rendered stories #30503

Merged
merged 3 commits into from
Oct 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 5 additions & 5 deletions extensions/amp-story/1.0/amp-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,11 @@ export class AmpStory extends AMP.BaseElement {
this.upgradeCtaAnchorTagsForTracking_(page, index);
});
this.initializeStoryNavigationPath_();

// Build pagination buttons if they can be displayed.
if (this.storeService_.get(StateProperty.CAN_SHOW_PAGINATION_BUTTONS)) {
new PaginationButtons(this);
}
})
.then(() => this.initializeBookend_())
.then(() => {
Expand Down Expand Up @@ -1018,11 +1023,6 @@ export class AmpStory extends AMP.BaseElement {
});
}

// Build pagination buttons if they can be displayed.
if (this.storeService_.get(StateProperty.CAN_SHOW_PAGINATION_BUTTONS)) {
new PaginationButtons(this);
}

// Will resolve when all pages are built.
return storyLayoutPromise;
}
Expand Down
8 changes: 4 additions & 4 deletions extensions/amp-story/1.0/pagination-buttons.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

/*
* In desktop panel mode i-amphtml-story-button-container acts as a sentinel
/*
* In desktop panel mode i-amphtml-story-button-container acts as a sentinel
* and covers the previous and next pages.
* In mobile it is focusable for screen readers and the buttons are hidden.
* In mobile it is focusable for screen readers and the buttons are hidden.
* In desktop full bleed it is not focusable since the buttons are visible.
*/
.i-amphtml-story-button-container {
Expand Down Expand Up @@ -162,7 +162,7 @@ amp-story:not([desktop]) .i-amphtml-story-button-container {
opacity: 1!important;
}

.i-amphtml-story-desktop-panels.i-amphtml-story-next-hover > .i-amphtml-story-fwd-replay >
.i-amphtml-story-desktop-panels.i-amphtml-story-next-hover > .i-amphtml-story-fwd-replay >
.i-amphtml-story-button-move {
opacity: 1 !important;
}
Expand Down