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

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

Issue 2506793002: MD Settings: Fix Back navigation from section route to BASIC route. (Closed)
Patch Set: address comments Created 4 years, 1 month 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 | chrome/test/data/webui/settings/basic_page_browsertest.js » ('j') | 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 02fbbcc869fbf63d3493b6ec7a63d8b0936c3b25..e22580b8ea6b27e59a75bcfd4515ceefdfbe4a0b 100644
--- a/chrome/browser/resources/settings/settings_page/main_page_behavior.js
+++ b/chrome/browser/resources/settings/settings_page/main_page_behavior.js
@@ -30,6 +30,12 @@ var MainPageBehaviorImpl = {
var oldRouteWasSection =
!!oldRoute && !!oldRoute.parent && !!oldRoute.section &&
oldRoute.parent.section != oldRoute.section;
+
+ if (oldRouteWasSection && newRoute == settings.Route.BASIC) {
+ this.scroller.scrollTop = 0;
+ return;
+ }
+
var scrollToSection =
!settings.lastRouteChangeWasPopstate() || oldRouteWasSection;
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/basic_page_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698