fixed inserttodo and use prompt instead

This commit is contained in:
quenousimporte 2023-10-19 12:24:44 +02:00
parent 40703c1764
commit 1d4e30ead9
1 changed files with 7 additions and 13 deletions

20
main.js
View File

@ -1106,22 +1106,16 @@ function downloadnotes()
function inserttodo()
{
filter.placeholder = "Text...";
filter.value = "";
filteredlist.hidden = true;
searchdialog.hidden = false;
filter.focus();
filter.select();
filter.onkeydown = function()
var text = prompt("Text:");
if (text)
{
if (event.key === "Enter")
var todo = getnote("todo");
todo.content += "\n" + text;
if (todo == currentnote)
{
event.preventDefault();
searchdialog.hidden = true;
getnote("todo").content += "\n" + filter.value;
datachanged();
seteditorcontent(todo.content, true);
}
datachanged();
}
}