Skip to content

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

Merged
camelburrito merged 8 commits intoampproject:masterfrom
camelburrito:sidebar
Nov 22, 2016
Merged

Force transfer sidebar to the Fixed 'transfer' layer.#6155
camelburrito merged 8 commits intoampproject:masterfrom
camelburrito:sidebar

Conversation

@camelburrito
Copy link
Copy Markdown
Contributor

fixes - #6045

this.vsync_.mutate(() => {
toggle(this.element, /* display */true);
this.viewport_.addToFixedLayer(this.element);
this.viewport_.addToFixedLayer(this.element, /*forceTransfer*/ true);
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.

nit: spaces inside the /**/

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

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

@dvoytenko
Copy link
Copy Markdown
Contributor

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

@camelburrito
Copy link
Copy Markdown
Contributor Author

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

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

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

// transfering of more substantial sections for now. Likely to be
// relaxed in the future.
const isTransferrable = (
const isTransferrable = fe.forceTransfer || (
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.

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.

2 participants