mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
hook on hash change which allows us navigation with alt-left, alt-right
This commit is contained in:
parent
58e3e8895a
commit
eddb3ed58a
@ -505,12 +505,16 @@ const noteTree = (function() {
|
|||||||
await getTree().reload(notes);
|
await getTree().reload(notes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getNotePathFromAddress() {
|
||||||
|
return document.location.hash.substr(1); // strip initial #
|
||||||
|
}
|
||||||
|
|
||||||
function loadTree() {
|
function loadTree() {
|
||||||
return server.get('tree').then(resp => {
|
return server.get('tree').then(resp => {
|
||||||
startNotePath = resp.start_note_path;
|
startNotePath = resp.start_note_path;
|
||||||
|
|
||||||
if (document.location.hash) {
|
if (document.location.hash) {
|
||||||
startNotePath = document.location.hash.substr(1); // strip initial #
|
startNotePath = getNotePathFromAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
return prepareNoteTree(resp.notes);
|
return prepareNoteTree(resp.notes);
|
||||||
@ -668,6 +672,12 @@ const noteTree = (function() {
|
|||||||
|
|
||||||
$(document).bind('keydown', 'ctrl+.', scrollToCurrentNote);
|
$(document).bind('keydown', 'ctrl+.', scrollToCurrentNote);
|
||||||
|
|
||||||
|
$(window).bind('hashchange', function() {
|
||||||
|
const notePath = getNotePathFromAddress();
|
||||||
|
|
||||||
|
activateNode(notePath);
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
reload,
|
reload,
|
||||||
collapseTree,
|
collapseTree,
|
||||||
|
@ -1 +1 @@
|
|||||||
module.exports = { build_date:"2017-12-18T00:01:16-05:00", build_revision: "f96e38fd13152eee4700ead265c5b255b8e6853e" };
|
module.exports = { build_date:"2017-12-18T23:45:10-05:00", build_revision: "b0e2d99a7b1073e9ee593b386afa19a62a2651eb" };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user