Skip to content

Commit

Permalink
Using enum.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmajoulet committed Jan 14, 2019
1 parent 59489c7 commit af8e462
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions extensions/amp-story/1.0/amp-story-page-attachment.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ import {
getStoreService,
} from './amp-story-store-service';
import {CSS} from '../../../build/amp-story-page-attachment-header-1.0.css';
import {HistoryStates} from './amp-story';
import {Layout} from '../../../src/layout';
import {closest} from '../../../src/dom';
import {createShadowRootWithStyle} from './utils';
import {createShadowRootWithStyle, setHistoryState} from './utils';
import {dev} from '../../../src/log';
import {htmlFor} from '../../../src/static-template';
import {resetStyles, setImportantStyles, toggle} from '../../../src/style';
import {setHistoryState} from './utils';

/** @const {number} */
const TOGGLE_THRESHOLD_PX = 50;
Expand Down Expand Up @@ -388,7 +388,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 @@ -416,6 +416,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 af8e462

Please sign in to comment.