From f77a29d7febc50f677046b7af13c29de33239704 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 7 Feb 2025 21:19:58 +0200 Subject: [PATCH] fix(note_tooltip): redundant padding on empty note with no children --- src/public/app/services/content_renderer.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/public/app/services/content_renderer.ts b/src/public/app/services/content_renderer.ts index 546d836d2..18aafdb4f 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) * @param {FNote} note * @returns {Promise} */ -async function renderChildrenList($renderedContent: JQuery, note: FNote) { +async function renderChildrenList($renderedContent: JQuery, 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); }