diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2020-04-22 00:34:56 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2020-04-22 00:34:56 +0900 |
| commit | 1f998168e2f6ff94d0119fe5f95ad03b47d19d60 (patch) | |
| tree | c739bf4de27f8f589061c2ea20ed5a4c432f9280 /src/client/scripts | |
| parent | chore: Update deps (diff) | |
| download | sharkey-1f998168e2f6ff94d0119fe5f95ad03b47d19d60.tar.gz sharkey-1f998168e2f6ff94d0119fe5f95ad03b47d19d60.tar.bz2 sharkey-1f998168e2f6ff94d0119fe5f95ad03b47d19d60.zip | |
feat(client): Implement default upload folder setting
Resolve #5985
Diffstat (limited to 'src/client/scripts')
| -rw-r--r-- | src/client/scripts/select-drive-file.ts | 1 | ||||
| -rw-r--r-- | src/client/scripts/select-drive-folder.ts | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/client/scripts/select-drive-file.ts b/src/client/scripts/select-drive-file.ts index 004ddf2fd9..798c270e3f 100644 --- a/src/client/scripts/select-drive-file.ts +++ b/src/client/scripts/select-drive-file.ts @@ -3,6 +3,7 @@ import DriveWindow from '../components/drive-window.vue'; export function selectDriveFile($root: any, multiple) { return new Promise((res, rej) => { const w = $root.new(DriveWindow, { + type: 'file', multiple }); w.$once('selected', files => { diff --git a/src/client/scripts/select-drive-folder.ts b/src/client/scripts/select-drive-folder.ts new file mode 100644 index 0000000000..68516e1010 --- /dev/null +++ b/src/client/scripts/select-drive-folder.ts @@ -0,0 +1,13 @@ +import DriveWindow from '../components/drive-window.vue'; + +export function selectDriveFolder($root: any, multiple) { + return new Promise((res, rej) => { + const w = $root.new(DriveWindow, { + type: 'folder', + multiple + }); + w.$once('selected', folders => { + res(multiple ? folders : (folders.length === 0 ? null : folders[0])); + }); + }); +} |