mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
scroll to current note in the tree
This commit is contained in:
parent
4e298d9d85
commit
fdc668e28b
@ -38,6 +38,10 @@
|
|||||||
<img src="stat/icons/list.png" alt="Collapse tree"/>
|
<img src="stat/icons/list.png" alt="Collapse tree"/>
|
||||||
</a>
|
</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 id="tree">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
BIN
static/icons/crosshair.png
Normal file
BIN
static/icons/crosshair.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 463 B |
@ -213,7 +213,7 @@ function decryptNoteAndSendToServer() {
|
|||||||
|
|
||||||
function decryptNoteIfNecessary(note) {
|
function decryptNoteIfNecessary(note) {
|
||||||
if (note.detail.encryption > 0) {
|
if (note.detail.encryption > 0) {
|
||||||
return decryptNote(note);
|
decryptNote(note);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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);
|
$(document).bind('keydown', 'alt+c', collapseTree);
|
Loading…
x
Reference in New Issue
Block a user