Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2714)

Unified Diff: chrome/browser/resources/settings/settings_page/main_page_behavior.js

Issue 2865753002: test instant subpage load with animation duration 0 (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698