From d96c7ae52887a5c50fb18f5819d1c44412f71bb6 Mon Sep 17 00:00:00 2001 From: syuilo <syuilotan@yahoo.co.jp> Date: Wed, 28 Feb 2018 00:34:57 +0900 Subject: [PATCH] Fix #1156 --- src/web/app/mobile/views/components/drive.file-detail.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/web/app/mobile/views/components/drive.file-detail.vue b/src/web/app/mobile/views/components/drive.file-detail.vue index 9a47eeb12c..e41ebbb451 100644 --- a/src/web/app/mobile/views/components/drive.file-detail.vue +++ b/src/web/app/mobile/views/components/drive.file-detail.vue @@ -6,7 +6,7 @@ :alt="file.name" :title="file.name" @load="onImageLoaded" - :style="`background-color:rgb(${ file.properties.average_color.join(',') })`"> + :style="style"> <template v-if="kind != 'image'">%fa:file%</template> <footer v-if="kind == 'image' && file.properties && file.properties.width && file.properties.height"> <span class="size"> @@ -84,6 +84,11 @@ export default Vue.extend({ }, kind(): string { return this.file.type.split('/')[0]; + }, + style(): any { + return this.file.properties.average_color ? { + 'background-color': `rgb(${ this.file.properties.average_color.join(',') })` + } : {}; } }, methods: {