Chromium Code Reviews| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 123 about: false, | 123 about: false, |
| 124 basic: newRoute.page == 'basic' || !this.inSubpage_, | 124 basic: newRoute.page == 'basic' || !this.inSubpage_, |
| 125 advanced: newRoute.page == 'advanced' || | 125 advanced: newRoute.page == 'advanced' || |
| 126 (!this.inSubpage_ && this.advancedToggleExpanded_), | 126 (!this.inSubpage_ && this.advancedToggleExpanded_), |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 if (this.showPages_.advanced) | 129 if (this.showPages_.advanced) |
| 130 this.advancedToggleExpanded_ = true; | 130 this.advancedToggleExpanded_ = true; |
| 131 } | 131 } |
| 132 | 132 |
| 133 // Wait for the dom-if changes prior to calculating the overflow padding. | 133 // Wait for any other changes prior to calculating the overflow padding. |
| 134 this.async(function() { | 134 this.async(function() { |
| 135 this.$.overscroll.style.paddingBottom = this.overscrollHeight_() + 'px'; | 135 this.$.overscroll.style.paddingBottom = this.overscrollHeight_() + 'px'; |
| 136 }); | 136 }); |
| 137 }, | 137 }, |
| 138 | 138 |
| 139 /** | 139 /** |
| 140 * Return the height that the over scroll padding should be set to. | 140 * Return the height that the over scroll padding should be set to. |
| 141 * This is used to determine how much padding to apply to the end of the | 141 * This is used to determine how much padding to apply to the end of the |
| 142 * content so that the last element may align with the top of the content | 142 * content so that the last element may align with the top of the content |
| 143 * area. | 143 * area. |
| 144 * @return {number} | 144 * @return {number} |
| 145 * @private | 145 * @private |
| 146 */ | 146 */ |
| 147 overscrollHeight_: function() { | 147 overscrollHeight_: function() { |
| 148 if (!this.currentRoute || this.currentRoute.subpage.length != 0 || | 148 if (!this.currentRoute || this.currentRoute.subpage.length != 0 || |
| 149 this.showPages_.about) { | 149 this.showPages_.about) { |
| 150 return 0; | 150 return 0; |
| 151 } | 151 } |
| 152 | 152 |
| 153 // Ensure any dom-if reflects the current properties. | |
| 154 Polymer.dom.flush(); | |
|
Dan Beam
2016/07/29 00:11:45
:_(
michaelpg
2016/07/29 17:27:15
there was a ton of discussion about this, but we c
Dan Beam
2016/07/29 18:28:39
I didn't say it was wrong, I just said I was said
Dan Beam
2016/07/29 18:28:54
I was just sad** to see it
| |
| 155 | |
| 153 /** | 156 /** |
| 154 * @param {!Element} element | 157 * @param {!Element} element |
| 155 * @return {number} | 158 * @return {number} |
| 156 */ | 159 */ |
| 157 var calcHeight = function(element) { | 160 var calcHeight = function(element) { |
| 158 var style = getComputedStyle(element); | 161 var style = getComputedStyle(element); |
| 159 var height = this.parentNode.scrollHeight - element.offsetHeight + | 162 var height = this.parentNode.scrollHeight - element.offsetHeight + |
| 160 parseFloat(style.marginTop) + parseFloat(style.marginBottom); | 163 parseFloat(style.marginTop) + parseFloat(style.marginBottom); |
| 161 assert(height >= 0); | 164 assert(height >= 0); |
| 162 return height; | 165 return height; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 222 return; | 225 return; |
| 223 } | 226 } |
| 224 | 227 |
| 225 this.toolbarSpinnerActive = false; | 228 this.toolbarSpinnerActive = false; |
| 226 this.showNoResultsFound_ = | 229 this.showNoResultsFound_ = |
| 227 !request.isSame('') && !request.didFindMatches(); | 230 !request.isSame('') && !request.didFindMatches(); |
| 228 }.bind(this)); | 231 }.bind(this)); |
| 229 }.bind(this), 0); | 232 }.bind(this), 0); |
| 230 }, | 233 }, |
| 231 }); | 234 }); |
| OLD | NEW |