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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force transfer sidebar to the Fixed 'transfer' layer. #6155

Merged
merged 8 commits into from Nov 22, 2016

Conversation

camelburrito
Copy link
Contributor

fixes - #6045

@@ -168,7 +168,7 @@ export class AmpSidebar extends AMP.BaseElement {
this.viewport_.disableTouchZoom();
this.vsync_.mutate(() => {
toggle(this.element, /* display */true);
this.viewport_.addToFixedLayer(this.element);
this.viewport_.addToFixedLayer(this.element, /*forceTransfer*/ true);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: spaces inside the /**/

Copy link
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
Contributor Author

@dvoytenko - this is not performing too well with animations - ill have to re-think this.

@dvoytenko
Copy link
Contributor

@camelburrito This probably simple means that we'll have to split addToFixedLayer and animation via different animation frames.

@camelburrito
Copy link
Contributor Author

i tried that already , the animation is stuttering and not looking very good.

@dvoytenko
Copy link
Contributor

@camelburrito If animation is stuttering, that simply means that we need to separate layout changes with animation run. 1 or 2 animation frames would do it.

@camelburrito
Copy link
Contributor Author

@dvoytenko could you take another look. I made a minor change in fixed-layer

@@ -307,7 +313,7 @@ export class FixedLayer {
// `height` is constrained to at most 300px. This is to avoid
// transfering of more substantial sections for now. Likely to be
// relaxed in the future.
const isTransferrable = (
const isTransferrable = fe.forceTransfer || (
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you added forceTransfer already in isFixed, you should defer to isFixed here. E.g. it should likely look like:

const isTransferrable = isFixed && (
     fe.forceTransfer || (opacity > 0 && ...)
  );

@camelburrito camelburrito merged commit 706fbf2 into ampproject:master Nov 22, 2016
@camelburrito camelburrito deleted the sidebar branch December 2, 2016 18:33
Lith pushed a commit to Lith/amphtml that referenced this pull request Dec 22, 2016
* Force transfer sidebar to the Fixed 'transfer' layer.

* review fix.

* Move to fixed layer before opening.

* Adding to fixed layer before dp block

* moving fl to build cb

* Make isFixed true for forceTransferElements

* Make isFixed true for forceTransferElements

* Review fixes
Lith pushed a commit to Lith/amphtml that referenced this pull request Dec 22, 2016
* Force transfer sidebar to the Fixed 'transfer' layer.

* review fix.

* Move to fixed layer before opening.

* Adding to fixed layer before dp block

* moving fl to build cb

* Make isFixed true for forceTransferElements

* Make isFixed true for forceTransferElements

* Review fixes
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.

None yet

2 participants