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 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); |
| + } |
| } |
| }, |