folder: fixes for timeline view

pull/363/head
Varun Patil 2023-01-17 21:18:27 -08:00
parent 1b14fc4901
commit fbbfbf18ec
3 changed files with 20 additions and 12 deletions

View File

@ -222,7 +222,7 @@ class ApiBase extends Controller
protected function isRecursive()
{
return null === $this->request->getParam('folder') || "1" === $this->request->getParam('recursive');
return null === $this->request->getParam('folder') || $this->request->getParam('recursive');
}
protected function isArchive()

View File

@ -637,7 +637,7 @@ export default defineComponent({
// Folder
if (this.$route.name === "folders") {
query.set("folder", utils.getFolderRoutePath(this.config_foldersPath));
if(this.$route.query.recursive === "1") {
if (this.$route.query.recursive) {
query.set("recursive", "1");
}
}

View File

@ -20,7 +20,11 @@
:to="{ query: recursive ? {} : { recursive: '1' } }"
close-after-click
>
{{ t("memories", recursive ? "Show folders" : "Timeline") }}
{{
recursive
? t("memories", "Folder View")
: t("memories", "Timeline View")
}}
<template #icon>
<FoldersIcon v-if="recursive" :size="20" />
<TimelineIcon v-else :size="20" />
@ -72,12 +76,12 @@ export default defineComponent({
HomeIcon,
ShareIcon,
TimelineIcon,
FoldersIcon
FoldersIcon,
},
data: () => ({
topMatter: null as TopMatterFolder | null,
recursive: false
recursive: false,
}),
watch: {
@ -109,13 +113,13 @@ export default defineComponent({
};
}),
};
this.recursive = this.$route.query.recursive === '1'
this.recursive = this.$route.query.recursive === "1";
} else {
this.topMatter = null;
this.recursive = false;
}
}
}
},
},
});
</script>
@ -134,6 +138,10 @@ export default defineComponent({
@media (max-width: 768px) {
margin-right: 10px;
}
:deep span {
cursor: pointer;
}
}
}
</style>