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

This commit is contained in:
Elian Doran 2025-02-07 21:19:58 +02:00
parent 9d097a0ee7
commit f77a29d7fe
No known key found for this signature in database

View File

@ -238,12 +238,16 @@ async function renderMermaid(note: FNote, $renderedContent: JQuery<HTMLElement>)
* @param {FNote} note * @param {FNote} note
* @returns {Promise<void>} * @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.css("padding", "10px");
$renderedContent.addClass("text-with-ellipsis"); $renderedContent.addClass("text-with-ellipsis");
let childNoteIds = note.getChildNoteIds();
if (childNoteIds.length > 10) { if (childNoteIds.length > 10) {
childNoteIds = childNoteIds.slice(0, 10); childNoteIds = childNoteIds.slice(0, 10);
} }