Support wider styling set for fixed layer. Re-enable forceTransfer on sidebar#6706
Merged
camelburrito merged 2 commits intoampproject:masterfrom Dec 16, 2016
Merged
Support wider styling set for fixed layer. Re-enable forceTransfer on sidebar#6706camelburrito merged 2 commits intoampproject:masterfrom
camelburrito merged 2 commits intoampproject:masterfrom
Conversation
dvoytenko
suggested changes
Dec 15, 2016
| @@ -85,7 +85,7 @@ export class AmpSidebar extends AMP.BaseElement { | |||
|
|
|||
| // TODO(camelburrito, #6699): Return forceTransfer=false once fixed layer | |||
src/service/fixed-layer.js
Outdated
| 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'); |
Contributor
There was a problem hiding this comment.
Remove _. It should be instead const bodyId = doc.body.id;
src/service/fixed-layer.js
Outdated
| 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'; |
Contributor
There was a problem hiding this comment.
And, yes, definitely tests :)
24339c8 to
07a1d5c
Compare
Contributor
Author
|
PTAL |
dvoytenko
approved these changes
Dec 16, 2016
07a1d5c to
d29a558
Compare
jridgewell
reviewed
Dec 16, 2016
| this.fixedLayer_.id = '-amp-fixedlayer'; | ||
| const doc = this.ampdoc.win.document; | ||
| const bodyId = doc.body.id; | ||
| this.fixedLayer_ = doc.createElement('body'); |
Contributor
There was a problem hiding this comment.
Why not do a shallow clone here? Then we have class, id and any other attributes.
Contributor
There was a problem hiding this comment.
Seems like shallow clone would work great, yes.
Contributor
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6699