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 and editing a single | 6 * @fileoverview Polymer element for displaying and editing a single |
7 * network proxy value. When the URL or port changes, a 'proxy-change' event is | 7 * network proxy value. When the URL or port changes, a 'proxy-change' event is |
8 * fired with the combined url and port values passed as a single string, | 8 * fired with the combined url and port values passed as a single string, |
9 * url:port. | 9 * url:port. |
10 */ | 10 */ |
(...skipping 28 matching lines...) Expand all Loading... |
39 }, | 39 }, |
40 notify: true, | 40 notify: true, |
41 }, | 41 }, |
42 }, | 42 }, |
43 | 43 |
44 /** | 44 /** |
45 * Event triggered when an input value changes. | 45 * Event triggered when an input value changes. |
46 * @private | 46 * @private |
47 */ | 47 */ |
48 onValueChange_: function() { | 48 onValueChange_: function() { |
49 if (!this.value.Host) | |
50 return; | |
51 var port = parseInt(this.value.Port, 10); | 49 var port = parseInt(this.value.Port, 10); |
52 if (isNaN(port)) | 50 if (isNaN(port)) |
53 port = 80; | 51 port = 80; |
54 this.value.Port = port; | 52 this.value.Port = port; |
55 this.fire('proxy-change', {value: this.value}); | 53 this.fire('proxy-change', {value: this.value}); |
56 } | 54 } |
57 }); | 55 }); |
OLD | NEW |