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

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

Issue 2230753002: MD Settings: methods to get root pages and sections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: defensive rebase Created 4 years, 4 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 | « chrome/browser/resources/settings/settings_main/settings_main.js ('k') | 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 59c66b29a452188ab468b30267263a1cf5f01f49..7eeedf2318f8baba885c85a8e24b2ff6e9d94707 100644
--- a/chrome/browser/resources/settings/settings_page/main_page_behavior.js
+++ b/chrome/browser/resources/settings/settings_page/main_page_behavior.js
@@ -60,7 +60,7 @@ var MainPageBehaviorImpl = {
*/
tryTransitionToSection_: function() {
var currentRoute = settings.getCurrentRoute();
- var currentSection = this.getSection_(currentRoute.section);
+ var currentSection = this.getSection(currentRoute.section);
// If an animation is already playing, try finishing or canceling it.
if (this.currentAnimation_) {
@@ -225,7 +225,7 @@ var MainPageBehaviorImpl = {
function() {
// If the current section changes while we are waiting for the page to
// be ready, scroll to the newest requested section.
- var section = this.getSection_(settings.getCurrentRoute().section);
+ var section = this.getSection(settings.getCurrentRoute().section);
if (section)
section.scrollIntoView();
}.bind(this));
@@ -235,13 +235,12 @@ var MainPageBehaviorImpl = {
* Helper function to get a section from the local DOM.
* @param {string} section Section name of the element to get.
* @return {?SettingsSectionElement}
- * @private
*/
- getSection_: function(section) {
+ getSection: function(section) {
if (!section)
return null;
return /** @type {?SettingsSectionElement} */(
- this.$$('[section=' + section + ']'));
+ this.$$('settings-section[section="' + section + '"]'));
},
/**
« no previous file with comments | « chrome/browser/resources/settings/settings_main/settings_main.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698