Commit 8d909aee authored by Demetrios Papadopoulos's avatar Demetrios Papadopoulos Committed by Commit Bot

Revert "Settings cleanup: Remove obsolete setTimeout() work-around."

This reverts commit 3194759c.

Reason for revert: Caused https://crbug.com/938839. Seems that the 
workaround is still needed even without animations.

Original change's description:
> Settings cleanup: Remove obsolete setTimeout() work-around.
> 
> This workaround refers to 859794 which is obsolete after removal of
> page/subpage animations.
> 
> Bug: 859794
> Change-Id: I688ec714117f90a797db1b1baacc6eb9d2138751
> Reviewed-on: https://chromium-review.googlesource.com/c/1490436
> Reviewed-by: Hector Carmona <hcarmona@chromium.org>
> Reviewed-by: calamity <calamity@chromium.org>
> Commit-Queue: calamity <calamity@chromium.org>
> Auto-Submit: Demetrios Papadopoulos <dpapad@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#636347}

TBR=calamity@chromium.org,dpapad@chromium.org,hcarmona@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 859794,938839
Change-Id: Id83ed5c68320815b75c49acb06b21afbb7ed9007
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1506464Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638317}
parent 1862faa9
......@@ -41,7 +41,8 @@ cr.define('settings', function() {
/**
* The |subpageScrollTarget| should only be set for this route.
* @private {settings.Route}
* @type {settings.Route}
* @private
*/
subpageRoute: Object,
......@@ -57,7 +58,20 @@ cr.define('settings', function() {
/** @param {!settings.Route} route */
currentRouteChanged: function(route) {
this.active_ = route == this.subpageRoute;
// Immediately set the scroll target to active when this page is
// activated, but wait a task to remove the scroll target when the page is
// deactivated. This gives scroll handlers like iron-list a chance to
// handle scroll events that are fired as a result of the route changing.
// TODO(https://crbug.com/859794): Having this timeout can result some
// jumpy behaviour in the scroll handlers. |this.active_| can be set
// immediately when this bug is fixed.
if (route == this.subpageRoute) {
this.active_ = true;
} else {
setTimeout(() => {
this.active_ = false;
});
}
},
/**
......
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