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 proxy exclusions. | 6 * @fileoverview Polymer element for displaying a list of proxy exclusions. |
7 * Includes UI for adding, changing, and removing entries. | 7 * Includes UI for adding, changing, and removing entries. |
8 */ | 8 */ |
9 | 9 |
10 (function() { | 10 (function() { |
11 | 11 |
12 Polymer({ | 12 Polymer({ |
13 is: 'network-proxy-exclusions', | 13 is: 'network-proxy-exclusions', |
14 | 14 |
15 properties: { | 15 properties: { |
16 /** Whether or not the proxy values can be edited. */ | 16 /** Whether or not the proxy values can be edited. */ |
17 editable: { | 17 editable: { |
18 type: Boolean, | 18 type: Boolean, |
19 value: false, | 19 value: false, |
20 }, | 20 }, |
21 | 21 |
22 /** | 22 /** |
23 * The list of exclusions. | 23 * The list of exclusions. |
24 * @type {!Array<string>} | 24 * @type {!Array<string>} |
25 */ | 25 */ |
26 exclusions: { | 26 exclusions: { |
27 type: Array, | 27 type: Array, |
28 value: function() { return []; }, | 28 value: function() { |
| 29 return []; |
| 30 }, |
29 notify: true | 31 notify: true |
30 } | 32 } |
31 }, | 33 }, |
32 | 34 |
33 /** | 35 /** |
34 * Event triggered when an item is removed. | 36 * Event triggered when an item is removed. |
35 * @param {!{model: !{index: number}}} event | 37 * @param {!{model: !{index: number}}} event |
36 * @private | 38 * @private |
37 */ | 39 */ |
38 onRemoveTap_: function(event) { | 40 onRemoveTap_: function(event) { |
39 var index = event.model.index; | 41 var index = event.model.index; |
40 this.splice('exclusions', index, 1); | 42 this.splice('exclusions', index, 1); |
41 this.fire('proxy-change'); | 43 this.fire('proxy-change'); |
42 } | 44 } |
43 }); | 45 }); |
44 })(); | 46 })(); |
OLD | NEW |