| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 }); |
| OLD | NEW |