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 * @typedef {{about: boolean, basic: boolean, advanced: boolean}} | 6 * @typedef {{about: boolean, basic: boolean, advanced: boolean}} |
| 7 */ | 7 */ |
| 8 var MainPageVisibility; | 8 var MainPageVisibility; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 181 (!this.hasExpandedSection_ && this.advancedToggleExpanded_), | 181 (!this.hasExpandedSection_ && this.advancedToggleExpanded_), |
| 182 }; | 182 }; |
| 183 | 183 |
| 184 if (this.showPages_.advanced) { | 184 if (this.showPages_.advanced) { |
| 185 assert(!this.pageVisibility || | 185 assert(!this.pageVisibility || |
| 186 this.pageVisibility.advancedSettings !== false); | 186 this.pageVisibility.advancedSettings !== false); |
| 187 this.advancedToggleExpanded_ = true; | 187 this.advancedToggleExpanded_ = true; |
| 188 } | 188 } |
| 189 } | 189 } |
| 190 | 190 |
| 191 // Wait for any other changes prior to calculating the overflow padding. | 191 // Calculate the overflow padding. |
| 192 this.setOverscroll_(this.overscrollHeight_()); | |
|
dschuyler
2016/09/08 21:00:37
I added some logging to see how often this call
ha
| |
| 193 | |
| 194 // Wait for any other changes, then calculate the overflow padding again. | |
| 192 setTimeout(function() { | 195 setTimeout(function() { |
| 193 // Ensure any dom-if reflects the current properties. | 196 // Ensure any dom-if reflects the current properties. |
| 194 Polymer.dom.flush(); | 197 Polymer.dom.flush(); |
| 195 | 198 |
| 196 this.setOverscroll_(this.overscrollHeight_()); | 199 this.setOverscroll_(this.overscrollHeight_()); |
| 197 }.bind(this)); | 200 }.bind(this)); |
| 198 }, | 201 }, |
| 199 | 202 |
| 200 /** | 203 /** |
| 201 * Return the height that the overscroll padding should be set to. | 204 * Return the height that the overscroll padding should be set to. |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 310 | 313 |
| 311 /** | 314 /** |
| 312 * @param {(boolean|undefined)} visibility | 315 * @param {(boolean|undefined)} visibility |
| 313 * @return {boolean} True unless visibility is false. | 316 * @return {boolean} True unless visibility is false. |
| 314 * @private | 317 * @private |
| 315 */ | 318 */ |
| 316 showAdvancedSettings_: function(visibility) { | 319 showAdvancedSettings_: function(visibility) { |
| 317 return visibility !== false; | 320 return visibility !== false; |
| 318 }, | 321 }, |
| 319 }); | 322 }); |
| OLD | NEW |