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

Unified Diff: chrome/browser/resources/settings/internet_page/network_summary_item.js

Issue 2260613003: MD Settings: Intenet: Fix network list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_638377_scrollable_behavior
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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698