mirror of
https://github.com/JanGross/quicknotes.git
synced 2026-12-01 02:17:00 +01:00
Fix exponential calls of save note.
This commit is contained in:
1 parent
21b4f692ac
commit
4663d18760
1 file changed
+3
-1
+3
-1
@@ -455,12 +455,14 @@ View.prototype = {
|
||||
});
|
||||
|
||||
// Handle hotkeys
|
||||
$(document).keyup(function(event) {
|
||||
$(document).off("keyup"); // FIXME: This prevent exponential calls of save note.
|
||||
$(document).on("keyup", function(event) {
|
||||
if (event.keyCode == 27) {
|
||||
event.stopPropagation();
|
||||
self.cancelEdit();
|
||||
}
|
||||
else if (event.keyCode == 13 && event.altKey) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
self.saveNote();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user