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

Side by Side Diff: chrome/browser/resources/settings/settings_main/settings_main.js

Issue 2197943002: MD Settings: fix a couple errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/settings/settings_menu/settings_menu.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'settings-main' displays the selected settings page. 7 * 'settings-main' displays the selected settings page.
8 */ 8 */
9 Polymer({ 9 Polymer({
10 is: 'settings-main', 10 is: 'settings-main',
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 if (!this.currentRoute || this.currentRoute.subpage.length != 0 || 144 if (!this.currentRoute || this.currentRoute.subpage.length != 0 ||
145 this.showPages_.about) { 145 this.showPages_.about) {
146 return 0; 146 return 0;
147 } 147 }
148 148
149 var query = 'settings-section[section="' + this.currentRoute.section + '"]'; 149 var query = 'settings-section[section="' + this.currentRoute.section + '"]';
150 var topSection = this.$$('settings-basic-page').$$(query); 150 var topSection = this.$$('settings-basic-page').$$(query);
151 if (!topSection && this.showPages_.advanced) 151 if (!topSection && this.showPages_.advanced)
152 topSection = this.$$('settings-advanced-page').$$(query); 152 topSection = this.$$('settings-advanced-page').$$(query);
153 153
154 if (!topSection) 154 if (!topSection || !topSection.offsetParent)
155 return 0; 155 return 0;
156 156
157 // Offset to the selected section (relative to the scrolling window). 157 // Offset to the selected section (relative to the scrolling window).
158 let sectionTop = topSection.offsetParent.offsetTop + topSection.offsetTop; 158 let sectionTop = topSection.offsetParent.offsetTop + topSection.offsetTop;
159 // The height of the selected section and remaining content (sections). 159 // The height of the selected section and remaining content (sections).
160 let heightOfShownSections = this.$.overscroll.offsetTop - sectionTop; 160 let heightOfShownSections = this.$.overscroll.offsetTop - sectionTop;
161 return Math.max(0, this.parentNode.scrollHeight - heightOfShownSections); 161 return Math.max(0, this.parentNode.scrollHeight - heightOfShownSections);
162 }, 162 },
163 163
164 /** @private */ 164 /** @private */
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 208
209 /** 209 /**
210 * @param {(boolean|undefined)} visibility 210 * @param {(boolean|undefined)} visibility
211 * @return {boolean} True unless visibility is false. 211 * @return {boolean} True unless visibility is false.
212 * @private 212 * @private
213 */ 213 */
214 showAdvancedSettings_: function(visibility) { 214 showAdvancedSettings_: function(visibility) {
215 return visibility !== false; 215 return visibility !== false;
216 }, 216 },
217 }); 217 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/settings/settings_menu/settings_menu.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698