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 * @fileoverview Polymer element for displaying a list of network properties | 6 * @fileoverview Polymer element for displaying a list of network properties |
7 * in a list. This also supports editing fields inline for fields listed in | 7 * in a list. This also supports editing fields inline for fields listed in |
8 * editFieldTypes. | 8 * editFieldTypes. |
9 */ | 9 */ |
10 Polymer({ | 10 Polymer({ |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 }, | 102 }, |
103 | 103 |
104 /** | 104 /** |
105 * Generates a filter function dependent on propertyDict and editFieldTypes. | 105 * Generates a filter function dependent on propertyDict and editFieldTypes. |
106 * @param {string} prefix | 106 * @param {string} prefix |
107 * @param {!Object} propertyDict | 107 * @param {!Object} propertyDict |
108 * @param {!Object} editFieldTypes | 108 * @param {!Object} editFieldTypes |
109 * @private | 109 * @private |
110 */ | 110 */ |
111 computeFilter_: function(prefix, propertyDict, editFieldTypes) { | 111 computeFilter_: function(prefix, propertyDict, editFieldTypes) { |
112 return function(key) { | 112 return key => { |
113 if (editFieldTypes.hasOwnProperty(key)) | 113 if (editFieldTypes.hasOwnProperty(key)) |
114 return true; | 114 return true; |
115 var value = this.getPropertyValue_(key, prefix, propertyDict); | 115 var value = this.getPropertyValue_(key, prefix, propertyDict); |
116 return value !== undefined && value !== ''; | 116 return value !== undefined && value !== ''; |
117 }.bind(this); | 117 }; |
118 }, | 118 }, |
119 | 119 |
120 /** | 120 /** |
121 * @param {string} key The property key. | 121 * @param {string} key The property key. |
122 * @param {string} type The field type. | 122 * @param {string} type The field type. |
123 * @param {!Object} propertyDict | 123 * @param {!Object} propertyDict |
124 * @param {!Object} editFieldTypes | 124 * @param {!Object} editFieldTypes |
125 * @return {boolean} | 125 * @return {boolean} |
126 * @private | 126 * @private |
127 */ | 127 */ |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 if (key == 'Tether.Carrier') { | 205 if (key == 'Tether.Carrier') { |
206 assert(typeof value == 'string'); | 206 assert(typeof value == 'string'); |
207 return (!value || value == 'unknown-carrier') ? | 207 return (!value || value == 'unknown-carrier') ? |
208 this.i18n('tetherUnknownCarrier') : | 208 this.i18n('tetherUnknownCarrier') : |
209 value; | 209 value; |
210 } | 210 } |
211 | 211 |
212 return ''; | 212 return ''; |
213 }, | 213 }, |
214 }); | 214 }); |
OLD | NEW |