client: select folder when entering it
Some checks failed
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/lint-backend Pipeline failed
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-sw Pipeline failed
ci/woodpecker/pr/test Pipeline failed

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:
Johann150 2022-12-23 02:21:52 +01:00
parent d26e2588e3
commit 02aaee6050
Signed by: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -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);