client: refactor

This commit is contained in:
Adorian Doran 2024-12-10 21:43:23 +02:00
parent 4325c90f09
commit f2067d0b12

View File

@ -272,8 +272,16 @@ async function getNoteTitleWithPathAsSuffix(notePath) {
const $titleWithPath = $('<span class="note-title-with-path">')
.append($('<span class="note-title">').text(title));
$titleWithPath.append(formatPath(path));
return $titleWithPath;
}
function formatPath(path) {
const $notePath = $('<span class="note-path">');
if (path.length > 0) {
const $notePath = $('<span class="note-path">');
$notePath.append($(`<span class="path-bracket"> (</span>)`));
@ -286,17 +294,17 @@ async function getNoteTitleWithPathAsSuffix(notePath) {
}
$notePath.append($(`<span class="path-bracket">)</span>)`));
$titleWithPath.append($notePath);
}
return $titleWithPath;
return $notePath;
}
function isNotePathInHiddenSubtree(notePath) {
return notePath?.includes("root/_hidden");
}
export default {
resolveNotePath,
resolveNotePathToSegments,