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

Unified Diff: ui/webui/resources/cr_elements/cr_network_list_item/cr_network_list_item.js

Issue 1100993002: Implement md-settings network lists. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename device-enabled-toggled, fix disabled network text Created 5 years, 8 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: 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);
}
},
});

Powered by Google App Engine
This is Rietveld 408576698