mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 13:29:14 +01:00
Addressed feedback
This commit is contained in:
@@ -147,7 +147,7 @@ export default ((userOpts?: Partial<Options>) => {
|
|||||||
<polyline points="6 9 12 15 18 9"></polyline>
|
<polyline points="6 9 12 15 18 9"></polyline>
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
<div id="explorer-content" class="">
|
<div id="explorer-content">
|
||||||
<ul class="overflow" id="explorer-ul">
|
<ul class="overflow" id="explorer-ul">
|
||||||
<ExplorerNode node={fileTree} opts={opts} fileData={fileData} />
|
<ExplorerNode node={fileTree} opts={opts} fileData={fileData} />
|
||||||
<li id="explorer-end" />
|
<li id="explorer-end" />
|
||||||
|
|||||||
@@ -134,8 +134,11 @@ export class FileNode {
|
|||||||
const traverse = (node: FileNode, currentPath: string) => {
|
const traverse = (node: FileNode, currentPath: string) => {
|
||||||
if (!node.file) {
|
if (!node.file) {
|
||||||
const folderPath = joinSegments(currentPath, node.name)
|
const folderPath = joinSegments(currentPath, node.name)
|
||||||
|
const collapseState = !currentFile.includes(
|
||||||
|
folderPath.replace("'", "-").replaceAll("../", ""),
|
||||||
|
)
|
||||||
if (folderPath !== "") {
|
if (folderPath !== "") {
|
||||||
folderPaths.push({ path: folderPath, collapsed })
|
folderPaths.push({ path: folderPath, collapsed: collapseState || collapsed })
|
||||||
}
|
}
|
||||||
|
|
||||||
node.children.forEach((child) => traverse(child, folderPath))
|
node.children.forEach((child) => traverse(child, folderPath))
|
||||||
|
|||||||
Reference in New Issue
Block a user