Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
hideChildrenOverview label which can disable children overview for specific notes
azivner7b59a665ddeb
diff --git a/src/public/javascripts/entities/note_short.js b/src/public/javascripts/entities/note_short.jsindex d5a18bc099..55cb896e99 100644--- a/src/public/javascripts/entities/note_short.js+++ b/src/public/javascripts/entities/note_short.js@@ -24,7 +24,7 @@ class NoteShort {}async getChildBranches() {- if (!this.treeCache.children) {+ if (!this.treeCache.children[this.noteId]) {return [];}diff --git a/src/public/javascripts/services/note_detail.js b/src/public/javascripts/services/note_detail.jsindex cbf648f744..fa287b599a 100644--- a/src/public/javascripts/services/note_detail.js+++ b/src/public/javascripts/services/note_detail.js@@ -176,12 +176,18 @@ async function loadNoteDetail(noteId) {// after loading new note make sure editor is scrolled to the top$noteDetailWrapper.scrollTop(0);- await loadLabelList();+ const labels = await loadLabelList();- await showChildrenOverview();+ const hideChildrenOverview = labels.some(label => label.name === 'hideChildrenOverview');+ await showChildrenOverview(hideChildrenOverview);}-async function showChildrenOverview() {+async function showChildrenOverview(hideChildrenOverview) {+ if (hideChildrenOverview) {+ $childrenOverview.hide();+ return;+ }+const note = getCurrentNote();$childrenOverview.empty();@@ -197,6 +203,8 @@ async function showChildrenOverview() {const childEl = $('<div class="child-overview">').html(link);$childrenOverview.append(childEl);}++ $childrenOverview.show();}async function loadLabelList() {@@ -216,6 +224,8 @@ async function loadLabelList() {else {$labelList.hide();}++ return labels;}async function loadNote(noteId) {diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.cssindex 6292e17357..8b3bc0a0bf 100644--- a/src/public/stylesheets/style.css+++ b/src/public/stylesheets/style.css@@ -36,7 +36,7 @@border: 0 !important;box-shadow: none !important;/* This is because with empty content height of editor is 0 and it's impossible to click into it */- min-height: 400px;+ min-height: 200px;overflow: auto;}@@ -291,7 +291,6 @@ div.ui-tooltip {}#children-overview {- padding-top: 20px;}.child-overview {@@ -305,6 +304,7 @@ div.ui-tooltip {border-radius: 15px;overflow: hidden;text-align: center;+ margin-top: 15px;}.child-overview a {diff --git a/src/services/labels.js b/src/services/labels.jsindex 203844fbd5..75ecd591a2 100644--- a/src/services/labels.js+++ b/src/services/labels.js@@ -11,7 +11,8 @@ const BUILTIN_LABELS = ['run','manualTransactionHandling','disableInclusion',- 'appCss'+ 'appCss',+ 'hideChildrenOverview'];async function getNotesWithLabel(name, value) {diff --git a/src/views/index.ejs b/src/views/index.ejsindex b1e358f38e..b98616b696 100644--- a/src/views/index.ejs+++ b/src/views/index.ejs@@ -205,7 +205,7 @@<input type="file" id="file-upload" style="display: none" /></div>- <div id="children-overview" style="flex-grow: 1000; flex-shrink: 1000; flex-basis: 1px; height: 100px; overflow: hidden; display: flex; flex-wrap: wrap">+ <div id="children-overview" style="flex-grow: 1000; flex-shrink: 1000; flex-basis: 0px; height: 100px; overflow: auto; display: flex; flex-wrap: wrap"></div></div>