From 1d4e30ead90049e4eefda3a4a8fdc23b699bb571 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Thu, 19 Oct 2023 12:24:44 +0200 Subject: [PATCH] fixed inserttodo and use prompt instead --- main.js | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/main.js b/main.js index ec2abde..d306220 100644 --- a/main.js +++ b/main.js @@ -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(); } }