Skip to content

Build your personal knowledge base with Trilium Notes

fix(note_tooltip): redundant padding on empty note with no children

Elian Doranf77a29d7febc
diff --git a/src/public/app/services/content_renderer.ts b/src/public/app/services/content_renderer.ts
index 546d836d23..18aafdb4f0 100644
--- a/src/public/app/services/content_renderer.ts
+++ b/src/public/app/services/content_renderer.ts
@@ -238,12 +238,16 @@ async function renderMermaid(note: FNote, $renderedContent: JQuery<HTMLElement>)
* @param {FNote} note
* @returns {Promise<void>}
*/
-async function renderChildrenList($renderedContent: JQuery<HTMLElement>, note: FNote) {
+async function renderChildrenList($renderedContent: JQuery<HTMLElement>, note: FNote) {
+ let childNoteIds = note.getChildNoteIds();
+
+ if (!childNoteIds.length) {
+ return;
+ }
+
$renderedContent.css("padding", "10px");
$renderedContent.addClass("text-with-ellipsis");
- let childNoteIds = note.getChildNoteIds();
-
if (childNoteIds.length > 10) {
childNoteIds = childNoteIds.slice(0, 10);
}