mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
Remove "Content of this note cannot be displayed" in the book format, fixes #3301
This commit is contained in:
parent
76f34e3eaf
commit
055bd77bd6
@ -33,26 +33,7 @@ async function getRenderedContent(note, options = {}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$renderedContent.css("padding", "10px");
|
await renderChildrenList($renderedContent, note);
|
||||||
$renderedContent.addClass("text-with-ellipsis");
|
|
||||||
|
|
||||||
let childNoteIds = note.getChildNoteIds();
|
|
||||||
|
|
||||||
if (childNoteIds.length > 10) {
|
|
||||||
childNoteIds = childNoteIds.slice(0, 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
// just load the first 10 child notes
|
|
||||||
const childNotes = await froca.getNotes(childNoteIds);
|
|
||||||
|
|
||||||
for (const childNote of childNotes) {
|
|
||||||
$renderedContent.append(await linkService.createNoteLink(`${note.noteId}/${childNote.noteId}`, {
|
|
||||||
showTooltip: false,
|
|
||||||
showNoteIcon: true
|
|
||||||
}));
|
|
||||||
|
|
||||||
$renderedContent.append("<br>");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (type === 'code') {
|
else if (type === 'code') {
|
||||||
@ -164,6 +145,9 @@ async function getRenderedContent(note, options = {}) {
|
|||||||
$renderedContent.append($("<div>").text("Error parsing content. Please check console.error() for more details."));
|
$renderedContent.append($("<div>").text("Error parsing content. Please check console.error() for more details."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (type === 'book') {
|
||||||
|
// nothing, book doesn't have its own content
|
||||||
|
}
|
||||||
else if (!options.tooltip && type === 'protected-session') {
|
else if (!options.tooltip && type === 'protected-session') {
|
||||||
const $button = $(`<button class="btn btn-sm"><span class="bx bx-log-in"></span> Enter protected session</button>`)
|
const $button = $(`<button class="btn btn-sm"><span class="bx bx-log-in"></span> Enter protected session</button>`)
|
||||||
.on('click', protectedSessionService.enterProtectedSession);
|
.on('click', protectedSessionService.enterProtectedSession);
|
||||||
@ -187,6 +171,29 @@ async function getRenderedContent(note, options = {}) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function renderChildrenList($renderedContent, note) {
|
||||||
|
$renderedContent.css("padding", "10px");
|
||||||
|
$renderedContent.addClass("text-with-ellipsis");
|
||||||
|
|
||||||
|
let childNoteIds = note.getChildNoteIds();
|
||||||
|
|
||||||
|
if (childNoteIds.length > 10) {
|
||||||
|
childNoteIds = childNoteIds.slice(0, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
// just load the first 10 child notes
|
||||||
|
const childNotes = await froca.getNotes(childNoteIds);
|
||||||
|
|
||||||
|
for (const childNote of childNotes) {
|
||||||
|
$renderedContent.append(await linkService.createNoteLink(`${note.noteId}/${childNote.noteId}`, {
|
||||||
|
showTooltip: false,
|
||||||
|
showNoteIcon: true
|
||||||
|
}));
|
||||||
|
|
||||||
|
$renderedContent.append("<br>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function trim(text, doTrim) {
|
function trim(text, doTrim) {
|
||||||
if (!doTrim) {
|
if (!doTrim) {
|
||||||
return text;
|
return text;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user