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

Unified Diff: chrome/browser/resources/settings/settings_main/settings_main.js

Issue 2307703002: MD Settings: Fix Advanced Toggle when on an Advanced section route. (Closed)
Patch Set: add test Created 4 years, 3 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
Index: chrome/browser/resources/settings/settings_main/settings_main.js
diff --git a/chrome/browser/resources/settings/settings_main/settings_main.js b/chrome/browser/resources/settings/settings_main/settings_main.js
index 27a07401995eb905a2e33c392078ebbdb7222b34..5c7f6c77c0e7def93f8f4f0ff5277116cebdefd3 100644
--- a/chrome/browser/resources/settings/settings_main/settings_main.js
+++ b/chrome/browser/resources/settings/settings_main/settings_main.js
@@ -92,7 +92,7 @@ Polymer({
attached: function() {
document.addEventListener('toggle-advanced-page', function(e) {
this.advancedToggleExpanded_ = e.detail;
- this.currentRouteChanged(settings.getCurrentRoute());
+ this.updatePagesShown_();
}.bind(this));
var currentRoute = settings.getCurrentRoute();
@@ -152,6 +152,8 @@ Polymer({
if (!newRoute.isSubpage())
this.hasExpandedSection_ = false;
+ this.advancedToggleExpanded_ = settings.Route.ADVANCED.contains(newRoute);
dschuyler 2016/09/01 23:36:00 This looks like it may collapse advanced if the ur
tommycli 2016/09/02 00:36:21 Done. And added a test
+
this.updatePagesShown_();
},
@@ -177,15 +179,10 @@ Polymer({
about: false,
basic: settings.Route.BASIC.contains(currentRoute) ||
!this.hasExpandedSection_,
- advanced: settings.Route.ADVANCED.contains(currentRoute) ||
- (!this.hasExpandedSection_ && this.advancedToggleExpanded_),
+ advanced: this.advancedToggleExpanded_ ||
+ (settings.Route.ADVANCED.contains(currentRoute) &&
+ this.hasExpandedSection_),
};
-
- if (this.showPages_.advanced) {
- assert(!this.pageVisibility ||
- this.pageVisibility.advancedSettings !== false);
- this.advancedToggleExpanded_ = true;
- }
}
// Wait for any other changes prior to calculating the overflow padding.

Powered by Google App Engine
This is Rietveld 408576698