Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰amp-consent scheduleLayout for prompt UI elements #15281

Merged
merged 3 commits into from May 15, 2018

Conversation

zhouyx
Copy link
Contributor

@zhouyx zhouyx commented May 14, 2018

Ideally runtime will handle the layout of prompt element. But currently element won't be laid out on fixed layer update. <amp-consent> need to take ownership of its children's layout.

@zhouyx zhouyx requested a review from lannka May 14, 2018 22:16
@@ -553,6 +559,7 @@ export class AmpConsent extends AMP.BaseElement {
this.getViewport().addToFixedLayer(this.element);
setImportantStyles(dev().assertElement(this.postPromptUI_),
{display: 'block'});
this.scheduleLayout(this.postPromptUI_);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as discussed, remove this.

{display: 'block'});
const uiElement = this.consentUI_[this.currentDisplayInstance_];
setImportantStyles(uiElement, {display: 'block'});
this.scheduleLayout(uiElement);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

document this is for amp-iframe which will be unlaid out on close.

@@ -131,6 +131,11 @@ export class AmpConsent extends AMP.BaseElement {
// TODO: Decide what to do with incorrect configuration.
this.assertAndParseConfig_();

const children = this.getRealChildren();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

document this is for amp-iframe which will be unlaid out on close.

@zhouyx zhouyx force-pushed the amp-consent-scheduleLayout branch from 0332de5 to 9ae021b Compare May 15, 2018 17:09
@lannka lannka merged commit 9adfa7e into ampproject:master May 15, 2018
erwinmombay pushed a commit that referenced this pull request May 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants