From 88fbc53e3703d830c1f645a29b6d6c611eff3384 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 15 Oct 2018 18:02:57 +0900 Subject: Resolve #2314 --- .../mobile/views/components/drive.file-detail.vue | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src') diff --git a/src/client/app/mobile/views/components/drive.file-detail.vue b/src/client/app/mobile/views/components/drive.file-detail.vue index 7425afe1e2..872f2f59b1 100644 --- a/src/client/app/mobile/views/components/drive.file-detail.vue +++ b/src/client/app/mobile/views/components/drive.file-detail.vue @@ -41,6 +41,8 @@ %fa:download% %i18n:@download% %fa:pencil-alt% %i18n:@rename% %fa:R folder-open% %i18n:@move% + %fa:R eye% %i18n:@unmark-as-sensitive% + %fa:R eye-slash% %i18n:@mark-as-sensitive% %fa:trash-alt R% %i18n:@delete% @@ -71,25 +73,30 @@ import { gcd } from '../../../../../prelude/math'; export default Vue.extend({ props: ['file'], + data() { return { gcd, exif: null }; }, + computed: { browser(): any { return this.$parent; }, + kind(): string { return this.file.type.split('/')[0]; }, + style(): any { return this.file.properties.avgColor && this.file.properties.avgColor.length == 3 ? { 'background-color': `rgb(${ this.file.properties.avgColor.join(',') })` } : {}; } }, + methods: { rename() { const name = window.prompt('%i18n:@rename%', this.file.name); @@ -101,6 +108,7 @@ export default Vue.extend({ this.browser.cf(this.file, true); }); }, + move() { (this as any).apis.chooseDriveFolder().then(folder => { (this as any).api('drive/files/update', { @@ -111,6 +119,7 @@ export default Vue.extend({ }); }); }, + del() { (this as any).api('drive/files/delete', { fileId: this.file.id @@ -118,9 +127,20 @@ export default Vue.extend({ this.browser.cd(this.file.folderId, true); }); }, + + toggleSensitive() { + (this as any).api('drive/files/update', { + fileId: this.file.id, + isSensitive: !this.file.isSensitive + }); + + this.file.isSensitive = !this.file.isSensitive; + }, + showCreatedAt() { alert(new Date(this.file.createdAt).toLocaleString()); }, + onImageLoaded() { const self = this; EXIF.getData(this.$refs.img, function(this: any) { -- cgit v1.2.3-freya