Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Improve sidebar CollapseItem: Separe doc and folder

Smaug6739bc6588c02e9e
diff --git a/frontend/components/Sidebar/CollapseItem.vue b/frontend/components/Sidebar/CollapseItem.vue
index e9f8bf8c..249e70e3 100644
--- a/frontend/components/Sidebar/CollapseItem.vue
+++ b/frontend/components/Sidebar/CollapseItem.vue
@@ -1,7 +1,12 @@
<template>
<div v-if="item.childrens?.length">
- <SidebarItem v-if="root" :item="item" @click="item.data.type != 'document' && toggleShow()" class="collapse-header" :class="{ doc: item.data.type == 'document' }">
- <svg @click="item.data.type == 'document' && toggleShow()" :class="{ rotated: !props.item.show.value }" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24">
+ <SidebarItem v-if="root && item.data.type == 'document'" :item="item" class="collapse-header doc">
+ <svg @click="toggleShow" :class="{ rotated: !props.item.show.value }" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24">
+ <path d="M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z" />
+ </svg>
+ </SidebarItem>
+ <SidebarItem v-else-if="root" :item="item" @click="toggleShow" class="collapse-header">
+ <svg :class="{ rotated: !props.item.show.value }" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24">
<path d="M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z" />
</svg>
</SidebarItem>