Skip to content

Commit

Permalink
Using enum.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmajoulet committed Jan 12, 2019
1 parent 3c5a3bc commit 17f31d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions extensions/amp-story/1.0/amp-story-page-attachment.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
StateProperty,
getStoreService,
} from './amp-story-store-service';
import {HistoryStates} from './amp-story';
import {Layout} from '../../../src/layout';
import {closest} from '../../../src/dom';
import {dev} from '../../../src/log';
Expand Down Expand Up @@ -369,7 +370,7 @@ export class AmpStoryPageAttachment extends AMP.BaseElement {

setHistoryState(
this.win,
'ampStoryAttachmentPageId',
HistoryStates.ATTACHMENT_PAGE_ID,
/** @type {string} */
(this.storeService_.get(StateProperty.CURRENT_PAGE_ID)));
}
Expand Down Expand Up @@ -397,6 +398,6 @@ export class AmpStoryPageAttachment extends AMP.BaseElement {
() => toggle(dev().assertElement(this.containerEl_), false), 250);
});

setHistoryState(this.win, 'ampStoryAttachmentPageId', null);
setHistoryState(this.win, HistoryStates.ATTACHMENT_PAGE_ID, null);
}
}
2 changes: 1 addition & 1 deletion extensions/amp-story/1.0/amp-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const Attributes = {
};

/** @enum {string} */
const HistoryStates = {
export const HistoryStates = {
ATTACHMENT_PAGE_ID: 'ampStoryAttachmentPageId',
BOOKEND_ACTIVE: 'ampStoryBookendActive',
PAGE_ID: 'ampStoryPageId',
Expand Down

0 comments on commit 17f31d2

Please sign in to comment.