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

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 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 fd15c75f0ae7886d02fbac1ad530f248703ce354..0a51d83336990ac5f7781c0685a69da3d21b623e 100644
--- a/chrome/browser/resources/settings/settings_page/main_page_behavior.js
+++ b/chrome/browser/resources/settings/settings_page/main_page_behavior.js
@@ -101,9 +101,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;
@@ -253,7 +250,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