Chromium Code Reviews| Index: chrome/browser/resources/settings/settings_page/main_page_behavior.js |
| diff --git a/chrome/browser/resources/settings/settings_page/main_page_behavior.js b/chrome/browser/resources/settings/settings_page/main_page_behavior.js |
| index 8fdf5f7e6e61f2e949d67e6f8acaa3df9fce936d..dd57065ed1bd1890c0403750f17dedb17ca49860 100644 |
| --- a/chrome/browser/resources/settings/settings_page/main_page_behavior.js |
| +++ b/chrome/browser/resources/settings/settings_page/main_page_behavior.js |
| @@ -11,6 +11,16 @@ |
| var MainPageBehaviorImpl = { |
| properties: { |
| /** |
| + * Help CSS to alter style during the horizontal swipe animation. |
| + * Note that this is unrelated to the |currentAnimation_| (which refers to |
| + * the vertical exapand animation). |
| + */ |
| + isSubpageAnimating: { |
| + reflectToAttribute: true, |
| + type: Boolean, |
| + }, |
| + |
| + /** |
| * Whether a search operation is in progress or previous search results are |
| * being displayed. |
| * @private {boolean} |
| @@ -25,6 +35,10 @@ var MainPageBehaviorImpl = { |
| /** @type {?HTMLElement} The scrolling container. */ |
| scroller: null, |
| + listeners: { |
| + 'neon-animation-finish': 'onNeonAnimationFinish_' |
| + }, |
| + |
| /** @override */ |
| attached: function() { |
| if (this.domHost && this.domHost.parentNode.tagName == 'PAPER-HEADER-PANEL') |
| @@ -34,6 +48,17 @@ var MainPageBehaviorImpl = { |
| }, |
| /** |
| + * Remove the is-animating attribute once the animation is complete. |
| + * This may catch animations finishing more often than needed, which is not |
| + * known to cause any issues (e.g. when animating from a shallower page to a |
| + * deeper page; or when transitioning to the main page). |
| + * @private |
| + */ |
| + onNeonAnimationFinish_: function() { |
| + this.isSubpageAnimating = false; |
| + }, |
| + |
| + /** |
| * @param {!settings.Route} newRoute |
| * @param {settings.Route} oldRoute |
| */ |
| @@ -57,6 +82,9 @@ var MainPageBehaviorImpl = { |
| !settings.lastRouteChangeWasPopstate() || oldRouteWasSection || |
| oldRoute == settings.Route.BASIC; |
| + if (oldRoute && newRoute.isSubpage() && oldRoute.depth > newRoute.depth) |
|
Dan Beam
2017/03/21 07:12:50
i'm still confused.
wouldn't we want to handle ch
dschuyler
2017/03/21 18:19:18
To the best of my knowledge an erroneous scroll ba
Dan Beam
2017/03/21 20:39:28
how about name hideOverflow?
dschuyler
2017/03/22 00:58:50
That would work for me :), but it seems to be 'pre
|
| + this.isSubpageAnimating = true; |
| + |
| // For previously uncreated pages (including on first load), allow the page |
| // to render before scrolling to or expanding the section. |
| if (!oldRoute || this.scrollHeight == 0) |