mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 18:39:22 +08:00
feat(in-app-help): add dedicated icon for folders
This commit is contained in:
parent
62dc11f9b8
commit
6215a21bae
@ -39,14 +39,20 @@ function parseNoteMeta(noteMeta: NoteMeta, docNameRoot: string): HiddenSubtreeIt
|
||||
type: "doc",
|
||||
attributes: []
|
||||
};
|
||||
let iconClass: string | undefined = undefined;
|
||||
|
||||
// Handle attributes
|
||||
for (const attribute of noteMeta.attributes ?? []) {
|
||||
if (attribute.name === "iconClass") {
|
||||
item.attributes?.push(attribute);
|
||||
iconClass = attribute.value;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle folder notes
|
||||
if (!noteMeta.dataFileName) {
|
||||
iconClass = "bx bx-folder";
|
||||
}
|
||||
|
||||
// Handle text notes
|
||||
if (noteMeta.type === "text" && noteMeta.dataFileName) {
|
||||
const docPath = `${docNameRoot}/${path.basename(noteMeta.dataFileName, ".html")}`
|
||||
@ -58,6 +64,7 @@ function parseNoteMeta(noteMeta: NoteMeta, docNameRoot: string): HiddenSubtreeIt
|
||||
});
|
||||
}
|
||||
|
||||
// Handle children
|
||||
if (noteMeta.children) {
|
||||
const children: HiddenSubtreeItem[] = [];
|
||||
for (const childMeta of noteMeta.children) {
|
||||
@ -68,5 +75,14 @@ function parseNoteMeta(noteMeta: NoteMeta, docNameRoot: string): HiddenSubtreeIt
|
||||
item.children = children;
|
||||
}
|
||||
|
||||
// Handle note icon
|
||||
if (iconClass) {
|
||||
item.attributes?.push({
|
||||
name: "iconClass",
|
||||
value: iconClass,
|
||||
type: "label"
|
||||
});
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user