included notes are not displayed in children overview

This commit is contained in:
zadam 2021-01-28 23:15:58 +01:00
parent d19a929237
commit 5eb9b8fe42
3 changed files with 23 additions and 9 deletions

View File

@ -220,7 +220,9 @@ class NoteListRenderer {
const $container = this.$noteList.find('.note-list-container').empty();
const imageLinks = this.parentNote ? this.parentNote.getRelations('imageLink') : [];
const includedLinks = this.parentNote
? this.parentNote.getRelations().filter(rel => rel.name === 'imageLink' || rel.name === 'includeNoteLink')
: [];
const startIdx = (this.page - 1) * this.pageSize;
const endIdx = startIdx + this.pageSize;
@ -229,8 +231,9 @@ class NoteListRenderer {
const pageNotes = await treeCache.getNotes(pageNoteIds);
for (const note of pageNotes) {
// image is already visible in the parent note so no need to display it separately in the book
if (imageLinks.find(rel => rel.value === note.noteId)) {
// note is already visible (either as image or included note) in the parent note
// so no need to display it separately in the book
if (includedLinks.find(rel => rel.value === note.noteId)) {
continue;
}

View File

@ -43,15 +43,15 @@ const TPL = `
}
.note-detail-editable-text h2 { font-size: 1.8em; }
.note-detail-editable-text h2::before { content: "##\\00a0\\00a0"; color: var(--muted-text-color); }
.note-detail-editable-text h2::before { content: "##\\2004"; color: var(--muted-text-color); }
.note-detail-editable-text h3 { font-size: 1.6em; }
.note-detail-editable-text h3::before { content: "###\\00a0\\00a0"; color: var(--muted-text-color); }
.note-detail-editable-text h3::before { content: "###\\2004"; color: var(--muted-text-color); }
.note-detail-editable-text h4 { font-size: 1.4em; }
.note-detail-editable-text h4::before { content: "####\\00a0\\00a0"; color: var(--muted-text-color); }
.note-detail-editable-text h4:not(.include-note-title)::before { content: "####\\2004"; color: var(--muted-text-color); }
.note-detail-editable-text h5 { font-size: 1.2em; }
.note-detail-editable-text h5::before { content: "#####\\00a0\\00a0"; color: var(--muted-text-color); }
.note-detail-editable-text h5::before { content: "#####\\2004"; color: var(--muted-text-color); }
.note-detail-editable-text h6 { font-size: 1.1em; }
.note-detail-editable-text h6::before { content: "######\\00a0\\00a0"; color: var(--muted-text-color); }
.note-detail-editable-text h6::before { content: "######\\2004"; color: var(--muted-text-color); }
.note-detail-editable-text {
font-family: var(--detail-text-font-family);

View File

@ -14,13 +14,24 @@ const TPL = `
.note-detail-readonly-text h5 { font-size: 1.2em; }
.note-detail-readonly-text h6 { font-size: 1.1em; }
.note-detail-readonly-text h2 { font-size: 1.8em; }
.note-detail-readonly-text h2::before { content: "##\\2004"; color: var(--muted-text-color); }
.note-detail-readonly-text h3 { font-size: 1.6em; }
.note-detail-readonly-text h3::before { content: "###\\2004"; color: var(--muted-text-color); }
.note-detail-readonly-text h4 { font-size: 1.4em; }
.note-detail-readonly-text h4:not(.include-note-title)::before { content: "####\\2004"; color: var(--muted-text-color); }
.note-detail-readonly-text h5 { font-size: 1.2em; }
.note-detail-readonly-text h5::before { content: "#####\\2004"; color: var(--muted-text-color); }
.note-detail-readonly-text h6 { font-size: 1.1em; }
.note-detail-readonly-text h6::before { content: "######\\2004"; color: var(--muted-text-color); }
.note-detail-readonly-text {
padding: 10px;
font-family: var(--detail-text-font-family);
position: relative;
}
.note-detail-readonly-text p:first-child, .note-detail-editable-text::before {
.note-detail-readonly-text p:first-child, .note-detail-readonly-text::before {
margin-top: 0;
}