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

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: 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..32939035523f24451ae9a42c0cfa3b7dd634204d 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) {
+ var section = this.getSection_(oldRoute.section);
+ if (section)
+ this.collapseSection(section);
+ }
+
+ if (newRoute && newRoute.section &&
+ this.$$('[data-page=' + newRoute.page + ']')) {
+ this.scrollToSection_();
+ }
+ } else { // The new route is a subpage.
dschuyler 2016/07/07 17:57:46 This could be "else if ...", but I think it is cle
michaelpg 2016/07/07 20:15:07 perhaps making the top-level if (newRouteIsSubpage
+ if (!oldRouteIsSubpage || newRoute.section != oldRoute.section) {
+ var section = this.getSection_(newRoute.section);
+ if (section)
+ this.expandSection(section);
+ }
}
},
« 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