forked from FoundKeyGang/FoundKey
client: select folder when entering it
As a convenience when a user is in the "select a folder" dialog, opens a folder an then clicks on the checkmark, the currently open folder is selected.
This commit is contained in:
parent
d26e2588e3
commit
02aaee6050
1 changed files with 8 additions and 2 deletions
|
@ -98,7 +98,6 @@ import { uploadFile, uploads } from '@/scripts/upload';
|
|||
|
||||
const props = withDefaults(defineProps<{
|
||||
initialFolder?: foundkey.entities.DriveFolder;
|
||||
type?: string;
|
||||
multiple?: boolean;
|
||||
select?: 'file' | 'folder' | null;
|
||||
}>(), {
|
||||
|
@ -133,7 +132,14 @@ let draghover = $ref(false);
|
|||
// (自分自身の階層にドロップできないようにするためのフラグ)
|
||||
let isDragSource = $ref(false);
|
||||
|
||||
watch($$(folder), () => emit('cd', folder));
|
||||
watch($$(folder), () => {
|
||||
emit('cd', folder)
|
||||
if (props.select === 'folder') {
|
||||
// convenience: entering a folder selects it
|
||||
selected = [folder];
|
||||
emit('change-selection', selected);
|
||||
}
|
||||
});
|
||||
|
||||
function onStreamDriveFileCreated(file: foundkey.entities.DriveFile) {
|
||||
addFile(file, true);
|
||||
|
|
Loading…
Reference in a new issue