todo list

This commit is contained in:
end-4
2025-04-17 12:31:51 +02:00
parent d6914a4ea2
commit 4db72d941e
11 changed files with 249 additions and 74 deletions
+13
View File
@@ -19,6 +19,17 @@ Singleton {
function markDone(index) {
if (index >= 0 && index < list.length) {
list[index].done = true
// Reassign to trigger onListChanged
root.list = list.slice(0)
todoFileView.setText(JSON.stringify(root.list))
}
}
function markUnfinished(index) {
if (index >= 0 && index < list.length) {
list[index].done = false
// Reassign to trigger onListChanged
root.list = list.slice(0)
todoFileView.setText(JSON.stringify(root.list))
}
}
@@ -26,6 +37,8 @@ Singleton {
function deleteItem(index) {
if (index >= 0 && index < list.length) {
list.splice(index, 1)
// Reassign to trigger onListChanged
root.list = list.slice(0)
todoFileView.setText(JSON.stringify(root.list))
}
}