mirror of
https://github.com/xlmnxp/extractify.zip.git
synced 2024-11-23 17:13:12 +03:00
fix click on file
This commit is contained in:
parent
c9dde79651
commit
564825f3a8
2
app.vue
2
app.vue
@ -54,7 +54,7 @@ onUnmounted(() => {
|
||||
|
||||
watchEffect(() => {
|
||||
const file = filesManager.getFile(selectedPath.value);
|
||||
filesGridList.value = file?.isFolder ? file.content : [];
|
||||
filesGridList.value = file?.content;
|
||||
|
||||
selectedList.value = [];
|
||||
for (const selectedElement of document.querySelectorAll(".selectable.selected")) {
|
||||
|
@ -13,8 +13,8 @@ let selectedPath = useSelectedPath();
|
||||
<template>
|
||||
<v-list :selected="[selectedPath]" density="compact" :nav="nav">
|
||||
<template v-for="file in filesList" :key="file.path">
|
||||
<v-list-item active-color="light-blue-darken-4" :active=file.active :title="file.name" :subtitle="file.path" :value="file.path"
|
||||
@click="() =>{
|
||||
<v-list-item active-color="light-blue-darken-4" :active=file.active :title="file.name" :subtitle="file.path"
|
||||
:value="file.path" @click="() => {
|
||||
selectedPath = file.path;
|
||||
file.toggle = !file.toggle;
|
||||
}">
|
||||
@ -27,10 +27,9 @@ let selectedPath = useSelectedPath();
|
||||
<v-icon>{{ `mdi-chevron-${file.toggle ? 'up' : 'down'}` }}</v-icon>
|
||||
</template>
|
||||
</v-list-item>
|
||||
<div :style="`background-color: rgba(0,0,0,0.05);${nav ? `border-radius: 4px;` : ''}` ">
|
||||
<template v-if="file.isFolder && file.toggle">
|
||||
<div v-if="file.isFolder && file.toggle"
|
||||
:style="`background-color: rgba(0,0,0,0.05);${nav ? `border-radius: 4px;` : ''}`">
|
||||
<TreeView :files-list="file.content" :nav="false"></TreeView>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</v-list>
|
||||
|
@ -144,7 +144,7 @@ export class FilesManager {
|
||||
|
||||
for (const file of (innerList || this.filesList.value)) {
|
||||
if (file.path == path) {
|
||||
file.content = file.content.sort((a:any, b:any) => {
|
||||
file.content = file.content?.sort((a:any, b:any) => {
|
||||
// sort by folder and from a to z
|
||||
if (a.isFolder && !b.isFolder) return -1;
|
||||
if (!a.isFolder && b.isFolder) return 1;
|
||||
@ -157,7 +157,7 @@ export class FilesManager {
|
||||
}
|
||||
|
||||
if (file.isFolder && path.includes(file.path)) {
|
||||
let recursiveFile = this.getFile(path, file.content);
|
||||
const recursiveFile = this.getFile(path, file.content);
|
||||
if (recursiveFile) {
|
||||
return recursiveFile;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user