Skip to content

Commit

Permalink
Use linker on swipe up (#33911)
Browse files Browse the repository at this point in the history
  • Loading branch information
mszylkowski committed Apr 20, 2021
1 parent e66c72f commit 38bd1b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/amp-story/analytics.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ <h1>Page Three</h1>
<amp-story-cta-layer>
<a href="https://google.com">CTA link</a>
</amp-story-cta-layer>
<amp-story-page-attachment layout="nodisplay" href="https://google.com"></amp-story-page-attachment>
</amp-story-page>

<amp-story-page id="p4" style="background-color: grey">
Expand Down
7 changes: 4 additions & 3 deletions extensions/amp-story/1.0/amp-story-page-attachment.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {getState} from '../../../src/history';
import {htmlFor} from '../../../src/static-template';
import {isPageAttachmentUiV2ExperimentOn} from './amp-story-open-page-attachment';
import {toggle} from '../../../src/style';
import {triggerClickFromLightDom} from './utils';

/** @const {string} */
const DARK_THEME_CLASS = 'i-amphtml-story-draggable-drawer-theme-dark';
Expand Down Expand Up @@ -292,10 +293,10 @@ export class AmpStoryPageAttachment extends DraggableDrawer {
// amp-story-page-attachment.css). The navigation itself will take some
// time, depending on the target and network conditions.
this.win.setTimeout(() => {
this.element.parentElement
const clickTarget = this.element.parentElement
.querySelector('.i-amphtml-story-page-open-attachment-host')
.shadowRoot.querySelector('a.i-amphtml-story-page-open-attachment')
.click();
.shadowRoot.querySelector('a.i-amphtml-story-page-open-attachment');
triggerClickFromLightDom(clickTarget, this.element);
}, 50);
});
}
Expand Down

0 comments on commit 38bd1b7

Please sign in to comment.