mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-03-24 15:05:42 -05:00
Addressed feedback
This commit is contained in:
parent
835f6a0d61
commit
26e0b4390b
@ -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))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user