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

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

Issue 2130613002: [MD settings] scroll to sections from subpages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit change Created 4 years, 5 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 4b6442c44c82c15ddccf7898de684603d1012755..933a0ec4baab3a6cd5c57404141fed70b549de6c 100644
--- a/chrome/browser/resources/settings/settings_page/main_page_behavior.js
+++ b/chrome/browser/resources/settings/settings_page/main_page_behavior.js
@@ -394,18 +394,23 @@ var RoutableBehaviorImpl = {
return;
}
- if (!newRouteIsSubpage && oldRouteIsSubpage) {
- var section = this.getSection_(oldRoute.section);
- if (section)
- this.collapseSection(section);
- } else if (newRouteIsSubpage &&
- (!oldRouteIsSubpage || newRoute.section != oldRoute.section)) {
- var section = this.getSection_(newRoute.section);
- if (section)
- this.expandSection(section);
- } else if (newRoute && newRoute.section &&
- this.$$('[data-page=' + newRoute.page + ']')) {
- this.scrollToSection_();
+ if (newRouteIsSubpage) {
+ if (!oldRouteIsSubpage || newRoute.section != oldRoute.section) {
+ var section = this.getSection_(newRoute.section);
+ if (section)
michaelpg 2016/07/20 19:45:05 when does this fail? seems like something the rout
dschuyler 2016/07/20 20:20:42 This code was simply moved in this CL, so I don't
+ this.expandSection(section);
+ }
+ } else {
+ if (oldRouteIsSubpage) {
+ var section = this.getSection_(oldRoute.section);
+ if (section)
+ this.collapseSection(section);
+ }
+
+ if (newRoute && newRoute.section &&
+ this.$$('[data-page=' + newRoute.page + ']')) {
+ this.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