Save note with Ctrl-S

This commit is contained in:
Skylar Ittner 2020-01-18 01:53:52 -07:00
parent 142349de64
commit a7c41a7577

View File

@ -178,6 +178,20 @@ $(".view-main").on("blur", "#notenumberinput,#notestreetinput", function () {
}
});
/*
* Save note with Ctrl-S
*/
$(".view-main").on("keydown", ".page[data-name=editnote]", function (event) {
if (event.ctrlKey || event.metaKey) {
switch (String.fromCharCode(event.which).toLowerCase()) {
case 's':
event.preventDefault();
saveNote($("#savenotebtn").data("noteid"));
break;
}
}
});
function getToggleName(id) {
for (i in SETTINGS.routenotetoggles) {
if (SETTINGS.routenotetoggles[i].id == id) {