mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-18 08:13:40 +08:00
client: refactor
This commit is contained in:
parent
4325c90f09
commit
f2067d0b12
@ -272,9 +272,17 @@ async function getNoteTitleWithPathAsSuffix(notePath) {
|
|||||||
const $titleWithPath = $('<span class="note-title-with-path">')
|
const $titleWithPath = $('<span class="note-title-with-path">')
|
||||||
.append($('<span class="note-title">').text(title));
|
.append($('<span class="note-title">').text(title));
|
||||||
|
|
||||||
if (path.length > 0) {
|
|
||||||
|
$titleWithPath.append(formatPath(path));
|
||||||
|
|
||||||
|
return $titleWithPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatPath(path) {
|
||||||
const $notePath = $('<span class="note-path">');
|
const $notePath = $('<span class="note-path">');
|
||||||
|
|
||||||
|
if (path.length > 0) {
|
||||||
|
|
||||||
$notePath.append($(`<span class="path-bracket"> (</span>)`));
|
$notePath.append($(`<span class="path-bracket"> (</span>)`));
|
||||||
|
|
||||||
for (let segmentIndex = 0; segmentIndex < path.length; segmentIndex++) {
|
for (let segmentIndex = 0; segmentIndex < path.length; segmentIndex++) {
|
||||||
@ -286,17 +294,17 @@ async function getNoteTitleWithPathAsSuffix(notePath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$notePath.append($(`<span class="path-bracket">)</span>)`));
|
$notePath.append($(`<span class="path-bracket">)</span>)`));
|
||||||
|
|
||||||
$titleWithPath.append($notePath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $titleWithPath;
|
return $notePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isNotePathInHiddenSubtree(notePath) {
|
function isNotePathInHiddenSubtree(notePath) {
|
||||||
return notePath?.includes("root/_hidden");
|
return notePath?.includes("root/_hidden");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
resolveNotePath,
|
resolveNotePath,
|
||||||
resolveNotePathToSegments,
|
resolveNotePathToSegments,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user