Index: ui/webui/resources/cr_elements/cr_network_list_item/cr_network_list_item.js |
diff --git a/ui/webui/resources/cr_elements/cr_network_list_item/cr_network_list_item.js b/ui/webui/resources/cr_elements/cr_network_list_item/cr_network_list_item.js |
index 39786b7f055ae6faa6a80268eb5cc385f00a0836..5180403417057f06e25084ca72d03e583cec0374 100644 |
--- a/ui/webui/resources/cr_elements/cr_network_list_item/cr_network_list_item.js |
+++ b/ui/webui/resources/cr_elements/cr_network_list_item/cr_network_list_item.js |
@@ -14,7 +14,7 @@ |
* Performs argument substitution, replacing %1, %2, etc in 'text' with |
* corresponding entries in |args|. |
* @param {string} text The string to perform the substitution on. |
- * @param {Array<string>} args The arguments to replace %1, %2, etc with. |
+ * @param {?Array<string>} args The arguments to replace %1, %2, etc with. |
*/ |
function getText(text, args) { |
var res = text; |
@@ -52,7 +52,7 @@ Polymer('cr-network-list-item', { |
* The ONC data properties used to display the list item. |
* |
* @attribute networkState |
- * @type CrOncDataElement |
+ * @type {?CrOncDataElement} |
* @default null |
*/ |
networkState: null, |
@@ -64,7 +64,7 @@ Polymer('cr-network-list-item', { |
* of the network type plus the network name and connection state. |
* |
* @attribute isListItem |
- * @type boolean |
+ * @type {boolean} |
* @default false |
Jeremy Klein
2015/04/27 22:29:03
nit: Isn't true the much more common case? I feel
stevenjb
2015/04/28 01:05:02
Yeah, I kind of agree, but it matches cr-network-i
|
*/ |
isListItem: false, |
@@ -83,12 +83,17 @@ Polymer('cr-network-list-item', { |
if (this.isListItem) { |
this.$.networkName.textContent = getText(network.Name); |
this.$.networkName.classList.toggle('connected', !isDisconnected); |
- } else { |
+ } else if (network.Name && network.ConnectionState) { |
this.$.networkName.textContent = getText(network.Type); |
this.$.networkName.classList.toggle('connected', false); |
this.$.networkState.textContent = |
getConnectionStateText(network.ConnectionState, network.Name); |
this.$.networkState.classList.toggle('connected', !isDisconnected); |
+ } else { |
+ this.$.networkName.textContent = getText(network.Type); |
+ this.$.networkName.classList.toggle('connected', false); |
+ this.$.networkState.textContent = getText('Disabled'); |
+ this.$.networkState.classList.toggle('connected', false); |
} |
}, |
}); |