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

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

Issue 2518233004: MD Settings: Move settings-advanced-page into settings-basic-page (Closed)
Patch Set: rebase/fix line lengths Created 4 years 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_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 904b12fa399d2a7536443a3ef7cdaacdff336c91..264dcb893abe812c45f660000b9977eb79106640 100644
--- a/chrome/browser/resources/settings/settings_page/main_page_behavior.js
+++ b/chrome/browser/resources/settings/settings_page/main_page_behavior.js
@@ -75,9 +75,6 @@ var MainPageBehaviorImpl = {
// If the section shouldn't be expanded, collapse it.
if (!currentRoute.isSubpage() || expandedSection != currentSection) {
promise = this.collapseSection_(expandedSection);
- // Scroll to the collapsed section.
- if (currentSection && scrollToSection)
- currentSection.scrollIntoView();
} else {
// Scroll to top while sliding to another subpage.
this.scroller.scrollTop = 0;
@@ -227,7 +224,11 @@ var MainPageBehaviorImpl = {
var newSection = settings.getCurrentRoute().section &&
this.getSection(settings.getCurrentRoute().section);
- this.scroller.scrollTop = this.origScrollTop_;
+ // Scroll to the new section or the original position.
+ if (newSection && !settings.lastRouteChangeWasPopstate())
+ newSection.scrollIntoView();
+ else
+ this.scroller.scrollTop = this.origScrollTop_;
this.currentAnimation_ = section.animateCollapse(
/** @type {!HTMLElement} */(this.scroller));

Powered by Google App Engine
This is Rietveld 408576698