Make Ctrl-S save note in editor
This commit is contained in:
parent
cd476b3f6d
commit
26232618d4
@ -12,9 +12,9 @@ function saveme(callback) {
|
||||
return;
|
||||
}
|
||||
app.toast.create({
|
||||
text: '<i class="fas fa-sync fa-spin"></i> Saving...',
|
||||
closeTimeout: 2 * 60 * 1000 // two whole minutes should be enough for *any* connection.
|
||||
}).open();
|
||||
text: '<i class="fas fa-sync fa-spin"></i> Saving...',
|
||||
closeTimeout: 2 * 60 * 1000 // two whole minutes should be enough for *any* connection.
|
||||
}).open();
|
||||
save_in_progress = true;
|
||||
sync(); // update textareas with correct content
|
||||
|
||||
@ -75,6 +75,18 @@ function exiteditor() {
|
||||
}
|
||||
}
|
||||
|
||||
$(window).bind('keydown', function (event) {
|
||||
if (event.ctrlKey || event.metaKey) {
|
||||
switch (String.fromCharCode(event.which).toLowerCase()) {
|
||||
case 's':
|
||||
event.preventDefault();
|
||||
sync();
|
||||
saveme();
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#noteframe").on("load", function () {
|
||||
init();
|
||||
});
|
@ -63,6 +63,18 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
"horizontal-rule"
|
||||
]
|
||||
});
|
||||
|
||||
window.addEventListener('keydown', function (event) {
|
||||
if (event.ctrlKey || event.metaKey) {
|
||||
switch (String.fromCharCode(event.which).toLowerCase()) {
|
||||
case 's':
|
||||
event.preventDefault();
|
||||
window.parent.sync();
|
||||
window.parent.saveme();
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getMarkdown() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user