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
scroll to current note in the tree
azivnerfdc668e28b05
diff --git a/src/templates/app.html b/src/templates/app.htmlindex 4993e0e697..88ae850c55 100644--- a/src/templates/app.html+++ b/src/templates/app.html@@ -38,6 +38,10 @@<img src="stat/icons/list.png" alt="Collapse tree"/></a>+ <a onclick="scrollToCurrentNote()" title="Scroll to current note" class="icon-action">+ <img src="stat/icons/crosshair.png" alt="Collapse tree"/>+ </a>+<div id="tree"></div></div>diff --git a/static/icons/crosshair.png b/static/icons/crosshair.pngnew file mode 100644index 0000000000..bf1bce8588Binary files /dev/null and b/static/icons/crosshair.png differdiff --git a/static/js/encryption.js b/static/js/encryption.jsindex cbbe1b46d6..1c6856b760 100644--- a/static/js/encryption.js+++ b/static/js/encryption.js@@ -213,7 +213,7 @@ function decryptNoteAndSendToServer() {function decryptNoteIfNecessary(note) {if (note.detail.encryption > 0) {- return decryptNote(note);+ decryptNote(note);}}diff --git a/static/js/tree.js b/static/js/tree.jsindex ffc6d57465..121aa893da 100644--- a/static/js/tree.js+++ b/static/js/tree.js@@ -179,4 +179,14 @@ function collapseTree() {});}+function scrollToCurrentNote() {+ const node = getNodeByKey(globalCurrentNote.detail.note_id);++ if (node) {+ node.makeVisible({scrollIntoView: true});++ node.setFocus();+ }+}+$(document).bind('keydown', 'alt+c', collapseTree);\ No newline at end of file