OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 var FilesMetadataBox = Polymer({ | 5 var FilesMetadataBox = Polymer({ |
6 is: 'files-metadata-box', | 6 is: 'files-metadata-box', |
7 | 7 |
8 properties: { | 8 properties: { |
9 // File media type, e.g. image, video. | 9 // File media type, e.g. image, video. |
10 type: String, | 10 type: String, |
11 size: String, | 11 size: String, |
12 modiifcationTime: String, | 12 modiifcationTime: String, |
13 filePath: String, | 13 filePath: String, |
14 mediaMimeType: String, | 14 mediaMimeType: String, |
15 | 15 |
16 // File type specific metadata below. | 16 // File type specific metadata below. |
17 imageWidth: Number, | 17 imageWidth: Number, |
18 imageHeight: Number, | 18 imageHeight: Number, |
19 mediaTitle: String, | 19 mediaTitle: String, |
20 mediaArtist: String, | 20 mediaArtist: String, |
21 | |
22 // Whether the value is the middle of loading. | |
23 loading: Boolean, | |
fukino
2016/09/06 09:12:44
'loading' sounds like all the properties are loadi
harukam
2016/09/06 11:25:24
Agree. I like 'isSizeLoading' better.
| |
21 }, | 24 }, |
22 | 25 |
23 // Clears fields. | 26 // Clears fields. |
24 clear: function() { | 27 clear: function() { |
25 this.type = ''; | 28 this.type = ''; |
26 this.size = ''; | 29 this.size = ''; |
27 this.modiifcationTime = ''; | 30 this.modiifcationTime = ''; |
28 this.mediaMimeType = ''; | 31 this.mediaMimeType = ''; |
29 this.filePath = ''; | 32 this.filePath = ''; |
30 | 33 |
31 this.imageWidth = 0; | 34 this.imageWidth = 0; |
32 this.imageHeight = 0; | 35 this.imageHeight = 0; |
33 this.mediaTitle = ''; | 36 this.mediaTitle = ''; |
34 this.mediaArtist = ''; | 37 this.mediaArtist = ''; |
38 | |
39 this.loading = false; | |
35 }, | 40 }, |
36 | 41 |
37 /** | 42 /** |
38 * @param {string} type | 43 * @param {string} type |
39 * @return {boolean} | 44 * @return {boolean} |
40 * | 45 * |
41 * @private | 46 * @private |
42 */ | 47 */ |
43 isImage_: function(type) { return type === 'image'; }, | 48 isImage_: function(type) { return type === 'image'; }, |
44 | 49 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 * @return {string} | 84 * @return {string} |
80 * | 85 * |
81 * @private | 86 * @private |
82 */ | 87 */ |
83 resolution_: function(imageWidth, imageHeight) { | 88 resolution_: function(imageWidth, imageHeight) { |
84 if (imageWidth && imageHeight) | 89 if (imageWidth && imageHeight) |
85 return imageWidth + " x " + imageHeight; | 90 return imageWidth + " x " + imageHeight; |
86 return ''; | 91 return ''; |
87 }, | 92 }, |
88 | 93 |
94 /** | |
95 * @param {boolean} loading | |
96 */ | |
97 setLoading: function(loading) { | |
fukino
2016/09/06 09:12:44
You can simply call, for example, 'metadataBox_.lo
harukam
2016/09/06 11:25:24
Acknowledged.
| |
98 this.loading = loading; | |
99 }, | |
89 }); | 100 }); |
OLD | NEW |