forked from Shinonome/dots-hyprland
todo widget: add ability to add items
This commit is contained in:
@@ -13,9 +13,19 @@ Singleton {
|
||||
|
||||
function addItem(item) {
|
||||
list.push(item)
|
||||
// Reassign to trigger onListChanged
|
||||
root.list = list.slice(0)
|
||||
todoFileView.setText(JSON.stringify(root.list))
|
||||
}
|
||||
|
||||
function addTask(desc) {
|
||||
const item = {
|
||||
"content": desc,
|
||||
"done": false,
|
||||
}
|
||||
addItem(item)
|
||||
}
|
||||
|
||||
function markDone(index) {
|
||||
if (index >= 0 && index < list.length) {
|
||||
list[index].done = true
|
||||
|
||||
Reference in New Issue
Block a user