added: force save on ctrl+s
This commit is contained in:
parent
0043b4978a
commit
88444f40fc
35
main.js
35
main.js
|
@ -274,8 +274,12 @@ var commands = [
|
|||
hint: "Show note info",
|
||||
action: showinfo,
|
||||
shortcut: "ctrl+w"
|
||||
}
|
||||
];
|
||||
},
|
||||
{
|
||||
hint: "Force save",
|
||||
action: save,
|
||||
shortcut: "ctrl+s"
|
||||
}];
|
||||
|
||||
var snippets = [
|
||||
{
|
||||
|
@ -1368,14 +1372,10 @@ function waitpending()
|
|||
});
|
||||
}
|
||||
|
||||
function datachanged()
|
||||
function save()
|
||||
{
|
||||
resize();
|
||||
|
||||
saved = false;
|
||||
|
||||
postpone()
|
||||
.then(waitpending)
|
||||
clearTimeout(workerid);
|
||||
waitpending()
|
||||
.then(() =>
|
||||
{
|
||||
var content = getnotecontent();
|
||||
|
@ -1428,6 +1428,16 @@ function datachanged()
|
|||
});
|
||||
}
|
||||
|
||||
function datachanged()
|
||||
{
|
||||
resize();
|
||||
|
||||
saved = false;
|
||||
|
||||
postpone()
|
||||
.then(save);
|
||||
}
|
||||
|
||||
function loadtodo()
|
||||
{
|
||||
loadnote("todo");
|
||||
|
@ -1586,12 +1596,7 @@ function splitshortcut(s)
|
|||
|
||||
function mainkeydownhandler()
|
||||
{
|
||||
if (event.key == "s" && event.ctrlKey)
|
||||
{
|
||||
event.preventDefault();
|
||||
console.log("ctrl+s is useless!");
|
||||
}
|
||||
else if (event.key == "Escape")
|
||||
if (event.key == "Escape")
|
||||
{
|
||||
if (!searchdialog.hidden)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue