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 3886816a9110fcb731267fad86474ae00c3b1cf4..3965992010b42f669936fdd76a1979683c839997 100644 |
| --- a/chrome/browser/resources/settings/settings_page/main_page_behavior.js |
| +++ b/chrome/browser/resources/settings/settings_page/main_page_behavior.js |
| @@ -36,7 +36,17 @@ var MainPageBehaviorImpl = { |
| scroller: null, |
| listeners: { |
| - 'neon-animation-finish': 'onNeonAnimationFinish_' |
| + 'neon-animation-finish': 'onNeonAnimationFinish_', |
| + 'subpage-expand': 'onSubpageExpand_', |
| + }, |
| + |
| + onSubpageExpand_: function() { |
| + debugger; |
| + if (this.oldDuration_) { |
| + settings.animation.Timing.DURATION = this.oldDuration_; |
| + document.body.querySelector('settings-ui::shadow #container').style.visibility = 'visible'; |
| + this.oldDuration_ = undefined; |
| + } |
| }, |
| /** @override */ |
| @@ -94,8 +104,14 @@ var MainPageBehaviorImpl = { |
| // 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) |
| + if (!oldRoute) { |
| + if (newRoute.isSubpage()) { |
| + this.oldDuration_ = settings.animation.Timing.DURATION; |
| + settings.animation.Timing.DURATION = 0; |
| + document.body.querySelector('settings-ui::shadow #container').style.visibility = 'hidden'; |
|
michaelpg
2017/05/05 20:42:44
using visibility: hidden instead of display: none
michaelpg
2017/05/22 22:10:51
(Copying scottchen's response to this thread:)
|
| + } |
| setTimeout(this.tryTransitionToSection_.bind(this, scrollToSection)); |
| + } |
| else |
| this.tryTransitionToSection_(scrollToSection); |
| }, |