From de77861c6827953a98ef7b158a6f7329c67dee82 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 26 Oct 2018 15:06:55 +0900 Subject: [PATCH] Client: Make drive folder deletable --- src/client/app/desktop/views/components/drive.folder.vue | 8 +++++--- src/client/app/desktop/views/components/drive.vue | 7 ++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/client/app/desktop/views/components/drive.folder.vue b/src/client/app/desktop/views/components/drive.folder.vue index cfc2b64ff..0bf2b7136 100644 --- a/src/client/app/desktop/views/components/drive.folder.vue +++ b/src/client/app/desktop/views/components/drive.folder.vue @@ -67,12 +67,12 @@ export default Vue.extend({ text: '%i18n:@contextmenu.rename%', icon: '%fa:i-cursor%', action: this.rename - }/*, null, { + }, null, { type: 'item', text: '%i18n:common.delete%', icon: '%fa:R trash-alt%', action: this.deleteFolder - }*/], { + }], { closed: () => { this.isContextmenuShowing = false; } @@ -207,7 +207,9 @@ export default Vue.extend({ }, deleteFolder() { - alert('not implemented yet'); + (this as any).api('drive/folders/delete', { + folderId: this.folder.id + }); } } }); diff --git a/src/client/app/desktop/views/components/drive.vue b/src/client/app/desktop/views/components/drive.vue index 054ba8b35..4d83a49ce 100644 --- a/src/client/app/desktop/views/components/drive.vue +++ b/src/client/app/desktop/views/components/drive.vue @@ -98,7 +98,7 @@ export default Vue.extend({ hierarchyFolders: [], selectedFiles: [], uploadings: [], - connection: null + connection: null, /** * ドロップされようとしているか @@ -122,6 +122,7 @@ export default Vue.extend({ this.connection.on('fileDeleted', this.onStreamDriveFileDeleted); this.connection.on('folderCreated', this.onStreamDriveFolderCreated); this.connection.on('folderUpdated', this.onStreamDriveFolderUpdated); + this.connection.on('folderDeleted', this.onStreamDriveFolderDeleted); if (this.initFolder) { this.move(this.initFolder); @@ -182,6 +183,10 @@ export default Vue.extend({ } }, + onStreamDriveFolderDeleted(folderId) { + this.removeFolder(folderId); + }, + onChangeUploaderUploads(uploads) { this.uploadings = uploads; },