Skip to content

Commit 045ca1f

Browse files
committed
global CTRL-SHIFT-arrows to move in the note tree without losing focus in the note editor
1 parent bf2db6e commit 045ca1f

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

public/javascripts/init.js

+36
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,42 @@ $(document).bind('keydown', 'ctrl+f', () => {
5757
}
5858
});
5959

60+
$(document).bind('keydown', "ctrl+shift+left", () => {
61+
const node = noteTree.getCurrentNode();
62+
node.navigate($.ui.keyCode.LEFT, true);
63+
64+
$("#note-detail").focus();
65+
66+
return false;
67+
});
68+
69+
$(document).bind('keydown', "ctrl+shift+right", () => {
70+
const node = noteTree.getCurrentNode();
71+
node.navigate($.ui.keyCode.RIGHT, true);
72+
73+
$("#note-detail").focus();
74+
75+
return false;
76+
});
77+
78+
$(document).bind('keydown', "ctrl+shift+up", () => {
79+
const node = noteTree.getCurrentNode();
80+
node.navigate($.ui.keyCode.UP, true);
81+
82+
$("#note-detail").focus();
83+
84+
return false;
85+
});
86+
87+
$(document).bind('keydown', "ctrl+shift+down", () => {
88+
const node = noteTree.getCurrentNode();
89+
node.navigate($.ui.keyCode.DOWN, true);
90+
91+
$("#note-detail").focus();
92+
93+
return false;
94+
});
95+
6096
$(window).on('beforeunload', () => {
6197
// this makes sure that when user e.g. reloads the page or navigates away from the page, the note's content is saved
6298
// this sends the request asynchronously and doesn't wait for result

0 commit comments

Comments
 (0)