| 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 }, |
| 21 |
| 22 /** |
| 23 * The list of exclusions. |
| 24 * @type {!Array<string>} |
| 25 */ |
| 26 exclusions: { |
| 27 type: Array, |
| 28 value: function() { |
| 29 return []; |
| 30 }, |
| 31 notify: true |
| 32 } |
| 20 }, | 33 }, |
| 21 | 34 |
| 22 /** | 35 /** |
| 23 * The list of exclusions. | 36 * Event triggered when an item is removed. |
| 24 * @type {!Array<string>} | 37 * @param {!{model: !{index: number}}} event |
| 38 * @private |
| 25 */ | 39 */ |
| 26 exclusions: { | 40 onRemoveTap_: function(event) { |
| 27 type: Array, | 41 var index = event.model.index; |
| 28 value: function() { return []; }, | 42 this.splice('exclusions', index, 1); |
| 29 notify: true | 43 this.fire('proxy-change'); |
| 30 } | 44 } |
| 31 }, | 45 }); |
| 32 | |
| 33 /** | |
| 34 * Event triggered when an item is removed. | |
| 35 * @param {!{model: !{index: number}}} event | |
| 36 * @private | |
| 37 */ | |
| 38 onRemoveTap_: function(event) { | |
| 39 var index = event.model.index; | |
| 40 this.splice('exclusions', index, 1); | |
| 41 this.fire('proxy-change'); | |
| 42 } | |
| 43 }); | |
| 44 })(); | 46 })(); |
| OLD | NEW |