Commit b1bfce5b authored by Kristi Park's avatar Kristi Park Committed by Commit Bot

[NTP] Re-add the opacity transition for shortcuts on first load

The transition was removed by changes in https://crrev.com/c/1591954.

Technically, the transition is a regression from pre-M69 behavior, but
is now considered accepted.

Change-Id: I832263f37f29b01c8c8e8bd699240ed21431bc6b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1604426
Commit-Queue: Kristi Park <kristipark@chromium.org>
Reviewed-by: default avatarKyle Milka <kmilka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658763}
parent e699e579
...@@ -832,11 +832,8 @@ function swapInNewTiles() { ...@@ -832,11 +832,8 @@ function swapInNewTiles() {
const parent = document.querySelector('#' + IDS.MOST_VISITED); const parent = document.querySelector('#' + IDS.MOST_VISITED);
// Only fade in the new tiles if there were tiles before.
let fadeIn = false;
const old = parent.querySelector('#' + IDS.MV_TILES); const old = parent.querySelector('#' + IDS.MV_TILES);
if (old) { if (old) {
fadeIn = true;
// Mark old tile DIV for removal after the transition animation is done. // Mark old tile DIV for removal after the transition animation is done.
old.removeAttribute('id'); old.removeAttribute('id');
old.classList.add('mv-tiles-old'); old.classList.add('mv-tiles-old');
...@@ -860,9 +857,7 @@ function swapInNewTiles() { ...@@ -860,9 +857,7 @@ function swapInNewTiles() {
// getComputedStyle causes the initial style (opacity 0) to be applied, so // getComputedStyle causes the initial style (opacity 0) to be applied, so
// that when we then set it to 1, that triggers the CSS transition. // that when we then set it to 1, that triggers the CSS transition.
if (fadeIn) { flushOpacity();
flushOpacity();
}
cur.style.opacity = 1.0; cur.style.opacity = 1.0;
if (document.documentElement.classList.contains(CLASSES.NO_INITIAL_FADE)) { if (document.documentElement.classList.contains(CLASSES.NO_INITIAL_FADE)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment