Chromium Code Reviews| Index: chrome/browser/resources/settings/internet_page/network_summary_item.js |
| diff --git a/chrome/browser/resources/settings/internet_page/network_summary_item.js b/chrome/browser/resources/settings/internet_page/network_summary_item.js |
| index 27a975364ba7f0218048fed9d147f15827349556..c2cfe849cfb93e61e1338238daffbaa2c282cb19 100644 |
| --- a/chrome/browser/resources/settings/internet_page/network_summary_item.js |
| +++ b/chrome/browser/resources/settings/internet_page/network_summary_item.js |
| @@ -14,9 +14,7 @@ Polymer({ |
| is: 'network-summary-item', |
| properties: { |
| - /** |
| - * True if the list is expanded. |
| - */ |
| + /** The expanded state of the list of networks. */ |
| expanded: { |
| type: Boolean, |
| value: false, |
| @@ -24,6 +22,15 @@ Polymer({ |
| }, |
| /** |
| + * Whether the list has been expanded. This is used to ensure the |
| + * iron-collapse section animates correctly. |
| + */ |
| + wasExpanded: { |
| + type: Boolean, |
| + value: false, |
| + }, |
| + |
| + /** |
| * The maximum height in pixels for the list of networks. |
| */ |
| maxHeight: { |
| @@ -101,6 +108,30 @@ Polymer({ |
| }, |
| /** |
|
dschuyler
2016/08/18 23:30:18
I think this needs a comment. Is this what this
fu
stevenjb
2016/08/19 00:20:43
Added a hopefully helpful comment.
|
| + * @return {boolean} |
| + * @private |
| + */ |
| + domIfIsVisible_() { |
| + if (this.expanded == this.wasExpanded) |
| + return this.expanded; |
| + if (this.expanded) { |
| + Polymer.RenderStatus.afterNextRender(this, function() { |
| + this.wasExpanded = true; |
| + }.bind(this)); |
| + return true; |
| + } |
| + return this.wasExpanded; |
| + }, |
| + |
| + /** |
|
dschuyler
2016/08/18 23:30:18
Please add a comment. Maybe:
* Always false until
stevenjb
2016/08/19 00:20:43
Acknowledged.
|
| + * @return {boolean} |
| + * @private |
| + */ |
| + ironCollapseIsOpened_() { |
| + return this.expanded && this.wasExpanded; |
| + }, |
| + |
| + /** |
| * @param {DeviceStateProperties} deviceState |
| * @return {boolean} |
| * @private |