Skip to content

Build your personal knowledge base with Trilium Notes

hook on hash change which allows us navigation with alt-left, alt-right

azivnereddb3ed58a44
diff --git a/public/javascripts/note_tree.js b/public/javascripts/note_tree.js
index 63ebb5a181..b6031678f8 100644
--- a/public/javascripts/note_tree.js
+++ b/public/javascripts/note_tree.js
@@ -505,12 +505,16 @@ const noteTree = (function() {
await getTree().reload(notes);
}
+ function getNotePathFromAddress() {
+ return document.location.hash.substr(1); // strip initial #
+ }
+
function loadTree() {
return server.get('tree').then(resp => {
startNotePath = resp.start_note_path;
if (document.location.hash) {
- startNotePath = document.location.hash.substr(1); // strip initial #
+ startNotePath = getNotePathFromAddress();
}
return prepareNoteTree(resp.notes);
@@ -668,6 +672,12 @@ const noteTree = (function() {
$(document).bind('keydown', 'ctrl+.', scrollToCurrentNote);
+ $(window).bind('hashchange', function() {
+ const notePath = getNotePathFromAddress();
+
+ activateNode(notePath);
+ });
+
return {
reload,
collapseTree,
diff --git a/services/build.js b/services/build.js
index 13a6403c21..46382d5f5a 100644
--- a/services/build.js
+++ b/services/build.js
@@ -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" };