Skip to content

Commit

Permalink
🖍 Hide pagination arrows in story embedmode=1 and embedmode=3 (#27463)
Browse files Browse the repository at this point in the history
* Hide pagination buttons for embedmode=1 and embedmode=3

* Negate condition

* Set default state
  • Loading branch information
newmuis committed Mar 30, 2020
1 parent 6bc7963 commit 04ef79c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions extensions/amp-story/1.0/amp-story-store-service.js
Expand Up @@ -80,6 +80,7 @@ export let InteractiveComponentDef;
* canInsertAutomaticAd: boolean,
* canShowBookend: boolean,
* canShowNavigationOverlayHint: boolean,
* canShowPaginationButtons: boolean,
* canShowPreviousPageHelp: boolean,
* canShowSharingUis: boolean,
* canShowSystemLayerButtons: boolean,
Expand Down Expand Up @@ -122,6 +123,7 @@ export const StateProperty = {
CAN_INSERT_AUTOMATIC_AD: 'canInsertAutomaticAd',
CAN_SHOW_BOOKEND: 'canShowBookend',
CAN_SHOW_NAVIGATION_OVERLAY_HINT: 'canShowNavigationOverlayHint',
CAN_SHOW_PAGINATION_BUTTONS: 'canShowPaginationButtons',
CAN_SHOW_PREVIOUS_PAGE_HELP: 'canShowPreviousPageHelp',
CAN_SHOW_SHARING_UIS: 'canShowSharingUis',
CAN_SHOW_SYSTEM_LAYER_BUTTONS: 'canShowSystemLayerButtons',
Expand Down Expand Up @@ -511,6 +513,7 @@ export class AmpStoryStoreService {
[StateProperty.CAN_SHOW_BOOKEND]: true,
[StateProperty.CAN_SHOW_NAVIGATION_OVERLAY_HINT]: true,
[StateProperty.CAN_SHOW_PREVIOUS_PAGE_HELP]: true,
[StateProperty.CAN_SHOW_PAGINATION_BUTTONS]: true,
[StateProperty.CAN_SHOW_SHARING_UIS]: true,
[StateProperty.CAN_SHOW_SYSTEM_LAYER_BUTTONS]: true,
[StateProperty.ACCESS_STATE]: false,
Expand Down Expand Up @@ -565,6 +568,7 @@ export class AmpStoryStoreService {
[StateProperty.CAN_INSERT_AUTOMATIC_AD]: false,
[StateProperty.CAN_SHOW_BOOKEND]: false,
[StateProperty.CAN_SHOW_NAVIGATION_OVERLAY_HINT]: false,
[StateProperty.CAN_SHOW_PAGINATION_BUTTONS]: false,
[StateProperty.CAN_SHOW_PREVIOUS_PAGE_HELP]: true,
[StateProperty.CAN_SHOW_SYSTEM_LAYER_BUTTONS]: false,
[StateProperty.MUTED_STATE]: false,
Expand All @@ -579,6 +583,7 @@ export class AmpStoryStoreService {
[StateProperty.CAN_INSERT_AUTOMATIC_AD]: false,
[StateProperty.CAN_SHOW_BOOKEND]: false,
[StateProperty.CAN_SHOW_NAVIGATION_OVERLAY_HINT]: false,
[StateProperty.CAN_SHOW_PAGINATION_BUTTONS]: false,
[StateProperty.CAN_SHOW_PREVIOUS_PAGE_HELP]: false,
[StateProperty.CAN_SHOW_SYSTEM_LAYER_BUTTONS]: false,
};
Expand Down
5 changes: 4 additions & 1 deletion extensions/amp-story/1.0/amp-story.js
Expand Up @@ -912,7 +912,10 @@ export class AmpStory extends AMP.BaseElement {

/** @private */
buildPaginationButtons_() {
if (this.paginationButtons_) {
if (
this.paginationButtons_ ||
!this.storeService_.get(StateProperty.CAN_SHOW_PAGINATION_BUTTONS)
) {
return;
}

Expand Down

0 comments on commit 04ef79c

Please sign in to comment.