Skip to content

Support wider styling set for fixed layer. Re-enable forceTransfer on sidebar#6706

Merged
camelburrito merged 2 commits intoampproject:masterfrom
camelburrito:sidebar
Dec 16, 2016
Merged

Support wider styling set for fixed layer. Re-enable forceTransfer on sidebar#6706
camelburrito merged 2 commits intoampproject:masterfrom
camelburrito:sidebar

Conversation

@camelburrito
Copy link
Copy Markdown
Contributor

Fixes #6699

@@ -85,7 +85,7 @@ export class AmpSidebar extends AMP.BaseElement {

// TODO(camelburrito, #6699): Return forceTransfer=false once fixed layer
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove TODO

this.fixedLayer_ = this.ampdoc.win.document.createElement('body');
this.fixedLayer_.id = '-amp-fixedlayer';
const doc = this.ampdoc.win.document;
const bodyId_ = doc.getElementsByTagName('body')[0].getAttribute('id');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove _. It should be instead const bodyId = doc.body.id;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

const doc = this.ampdoc.win.document;
const bodyId_ = doc.getElementsByTagName('body')[0].getAttribute('id');
this.fixedLayer_ = doc.createElement('body');
this.fixedLayer_.id = bodyId_ || '-amp-fixedlayer';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

And, yes, definitely tests :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@camelburrito
Copy link
Copy Markdown
Contributor Author

PTAL

@camelburrito camelburrito merged commit ff2282f into ampproject:master Dec 16, 2016
@camelburrito camelburrito deleted the sidebar branch December 16, 2016 02:26
this.fixedLayer_.id = '-amp-fixedlayer';
const doc = this.ampdoc.win.document;
const bodyId = doc.body.id;
this.fixedLayer_ = doc.createElement('body');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why not do a shallow clone here? Then we have class, id and any other attributes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems like shallow clone would work great, yes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

But we'll have to reset fixedLayer.style because we override it for real body for many things.

jridgewell added a commit to jridgewell/amphtml that referenced this pull request Dec 16, 2016
Re: ampproject#6706 (comment)

Also removes a [temporary fix](ampproject#4097) that is [no longer necessary](ampproject#6033).
jridgewell added a commit to jridgewell/amphtml that referenced this pull request Dec 16, 2016
Re: ampproject#6706 (comment)

Also removes a [temporary fix](ampproject#4097) that is [no longer necessary](ampproject#6033).
jridgewell added a commit to jridgewell/amphtml that referenced this pull request Dec 16, 2016
Re: ampproject#6706 (comment)

Also removes a [temporary fix](ampproject#4097) that is [no longer necessary](ampproject#6033).
jridgewell added a commit to jridgewell/amphtml that referenced this pull request Dec 16, 2016
Re: ampproject#6706 (comment)

Also removes a [temporary fix](ampproject#4097) that is [no longer necessary](ampproject#6033).
jridgewell added a commit to jridgewell/amphtml that referenced this pull request Dec 16, 2016
Re: ampproject#6706 (comment)

Also removes a [temporary fix](ampproject#4097) that is [no longer necessary](ampproject#6033).
jridgewell added a commit that referenced this pull request Dec 20, 2016
* Use #cloneNode to clone FixedLayer body

Re: #6706 (comment)

Also removes a [temporary fix](#4097) that is [no longer necessary](#6033).

* Fix test
Lith pushed a commit to Lith/amphtml that referenced this pull request Dec 22, 2016
… sidebar (ampproject#6706)

* Support wider styling set for fixed layer. Re-enable forceTransfer on sidebar

* Review changes and tests
Lith pushed a commit to Lith/amphtml that referenced this pull request Dec 22, 2016
* Use #cloneNode to clone FixedLayer body

Re: ampproject#6706 (comment)

Also removes a [temporary fix](ampproject#4097) that is [no longer necessary](ampproject#6033).

* Fix test
Lith pushed a commit to Lith/amphtml that referenced this pull request Dec 22, 2016
… sidebar (ampproject#6706)

* Support wider styling set for fixed layer. Re-enable forceTransfer on sidebar

* Review changes and tests
Lith pushed a commit to Lith/amphtml that referenced this pull request Dec 22, 2016
* Use #cloneNode to clone FixedLayer body

Re: ampproject#6706 (comment)

Also removes a [temporary fix](ampproject#4097) that is [no longer necessary](ampproject#6033).

* Fix test
torch2424 pushed a commit to torch2424/amphtml that referenced this pull request Jan 3, 2017
… sidebar (ampproject#6706)

* Support wider styling set for fixed layer. Re-enable forceTransfer on sidebar

* Review changes and tests
torch2424 pushed a commit to torch2424/amphtml that referenced this pull request Jan 3, 2017
* Use #cloneNode to clone FixedLayer body

Re: ampproject#6706 (comment)

Also removes a [temporary fix](ampproject#4097) that is [no longer necessary](ampproject#6033).

* Fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants