Skip to content

Commit

Permalink
Delete the amp-story-scroll experiment. (ampproject#19153)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmajoulet authored and Enriqe committed Nov 28, 2018
1 parent 5c7efcc commit 6e5d637
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 57 deletions.
28 changes: 0 additions & 28 deletions extensions/amp-story/1.0/amp-story-scroll.css

This file was deleted.

1 change: 0 additions & 1 deletion extensions/amp-story/1.0/amp-story-store-service.js
Expand Up @@ -52,7 +52,6 @@ export const getStoreService = win => {
export const UIType = {
MOBILE: 0,
DESKTOP: 1,
SCROLL: 2,
};


Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-story/1.0/amp-story-system-layer.js
Expand Up @@ -521,7 +521,7 @@ export class SystemLayer {
* @private
*/
onUIStateUpdate_(uiState) {
if ([UIType.SCROLL, UIType.DESKTOP].includes(uiState)) {
if (uiState === UIType.DESKTOP) {
this.buildSharePill_();
}

Expand Down
1 change: 0 additions & 1 deletion extensions/amp-story/1.0/amp-story.css
Expand Up @@ -15,7 +15,6 @@
*/

@import './amp-story-access.css';
@import './amp-story-scroll.css';
@import './amp-story-desktop.css';
@import './amp-story-user-overridable.css';

Expand Down
25 changes: 5 additions & 20 deletions extensions/amp-story/1.0/amp-story.js
Expand Up @@ -351,10 +351,7 @@ export class AmpStory extends AMP.BaseElement {
this.initializeListenersForDev_();

if (this.isDesktop_()) {
const uiState =
isExperimentOn(this.win, 'amp-story-scroll') ?
UIType.SCROLL : UIType.DESKTOP;
this.storeService_.dispatch(Action.TOGGLE_UI, uiState);
this.storeService_.dispatch(Action.TOGGLE_UI, UIType.DESKTOP);
}

this.navigationState_.observe(stateChangeEvent => {
Expand Down Expand Up @@ -1259,12 +1256,7 @@ export class AmpStory extends AMP.BaseElement {
onResize() {
this.updateViewportSizeStyles_();

let uiState = UIType.MOBILE;

if (this.isDesktop_()) {
uiState = isExperimentOn(this.win, 'amp-story-scroll') ?
UIType.SCROLL : UIType.DESKTOP;
}
const uiState = this.isDesktop_() ? UIType.DESKTOP : UIType.MOBILE;

this.storeService_.dispatch(Action.TOGGLE_UI, uiState);

Expand Down Expand Up @@ -1315,16 +1307,14 @@ export class AmpStory extends AMP.BaseElement {
* @private
*/
onUIStateUpdate_(uiState) {
this.vsync_.mutate(() => {
this.element.removeAttribute('desktop');
this.element.removeAttribute('scroll');
});

switch (uiState) {
case UIType.MOBILE:
// Preloads and prerenders the share menu as the share button gets
// visible on the mobile UI. No-op if already built.
this.shareMenu_.build();
this.vsync_.mutate(() => {
this.element.removeAttribute('desktop');
});
break;
case UIType.DESKTOP:
this.setDesktopPositionAttributes_(this.activePage_);
Expand All @@ -1339,11 +1329,6 @@ export class AmpStory extends AMP.BaseElement {
this.updateBackground_(this.activePage_.element, /* initial */ true);
}
break;
case UIType.SCROLL:
this.vsync_.mutate(() => {
this.element.setAttribute('scroll', '');
});
break;
}
}

Expand Down
6 changes: 0 additions & 6 deletions tools/experiments/experiments.js
Expand Up @@ -248,12 +248,6 @@ const EXPERIMENTS = [
spec: 'https://github.com/ampproject/amphtml/issues/15955',
cleanupIssue: 'https://github.com/ampproject/amphtml/issues/15960',
},
{
id: 'amp-story-scroll',
name: 'Scrollable experience for amp-story',
spec: 'https://github.com/ampproject/amphtml/issues/16465',
cleanupIssue: 'https://github.com/ampproject/amphtml/issues/16466',
},
{
id: 'amp-story-hold-to-pause',
name: 'Hold to pause an amp-story',
Expand Down

0 comments on commit 6e5d637

Please sign in to comment.