OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright 2016 The Chromium Authors. All rights reserved. | 3 Copyright 2016 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 | 7 |
8 <!-- | 8 <!-- |
9 An element displaying basic information about a display item in a list view. | 9 An element displaying basic information about a display item in a list view. |
10 --> | 10 --> |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // For example, given "FooDisplayItem type=hello\nworld", produces | 82 // For example, given "FooDisplayItem type=hello\nworld", produces |
83 // "FooDisplayItem" as the first capture and "type=hello\nworld" as the | 83 // "FooDisplayItem" as the first capture and "type=hello\nworld" as the |
84 // second. Either capture could be the empty string, but this regex will | 84 // second. Either capture could be the empty string, but this regex will |
85 // still successfully match. | 85 // still successfully match. |
86 var DETAILS_SPLIT_REGEX = /^(\S*)\s*([\S\s]*)$/; | 86 var DETAILS_SPLIT_REGEX = /^(\S*)\s*([\S\s]*)$/; |
87 | 87 |
88 Polymer({ | 88 Polymer({ |
89 is: 'tr-ui-e-chrome-cc-display-item-list-item', | 89 is: 'tr-ui-e-chrome-cc-display-item-list-item', |
90 | 90 |
91 created: function() { | 91 created: function() { |
92 this.name = ''; | 92 // TODO(charliea): Why is setAttribute necessary here but not below? We |
93 this.rawDetails = ''; | 93 // should reach out to the Polymer team to figure out. |
94 this.richDetails = undefined; | 94 this.setAttribute('name', ''); |
95 this.data_ = undefined; | 95 this.setAttribute('rawDetails', ''); |
| 96 this.setAttribute('richDetails', undefined); |
| 97 this.setAttribute('data_', undefined); |
96 }, | 98 }, |
97 | 99 |
98 get data() { | 100 get data() { |
99 return this.data_; | 101 return this.data_; |
100 }, | 102 }, |
101 | 103 |
102 set data(data) { | 104 set data(data) { |
103 this.data_ = data; | 105 this.data_ = data; |
104 | 106 |
105 if (!data) { | 107 if (!data) { |
(...skipping 19 matching lines...) Expand all Loading... |
125 _computeIf: function(richDetails) { | 127 _computeIf: function(richDetails) { |
126 return richDetails && richDetails.skp64; | 128 return richDetails && richDetails.skp64; |
127 }, | 129 }, |
128 | 130 |
129 _computeHref: function(richDetails) { | 131 _computeHref: function(richDetails) { |
130 return 'data:application/octet-stream;base64,' + richDetails.skp64; | 132 return 'data:application/octet-stream;base64,' + richDetails.skp64; |
131 } | 133 } |
132 }); | 134 }); |
133 })(); | 135 })(); |
134 </script> | 136 </script> |
OLD | NEW |