1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Merge pull request #588 from Seanstoppable/fixscrollableandtodoist

Fix delete/close of todoist
This commit is contained in:
Chris Cummer
2019-09-01 08:20:58 -07:00
committed by GitHub
2 changed files with 15 additions and 5 deletions

View File

@@ -104,25 +104,26 @@ func (widget *Widget) Unselect() {
// Close closes the currently-selected task in the currently-selected project
func (w *Widget) Close() {
w.CurrentProject().closeSelectedTask()
w.SetItemCount(len(w.CurrentProject().tasks))
if w.CurrentProject().isLast() {
w.Prev()
return
}
w.Next()
w.CurrentProject().index = w.Selected
w.RenderFunction()
}
// Delete deletes the currently-selected task in the currently-selected project
func (w *Widget) Delete() {
w.CurrentProject().deleteSelectedTask()
w.SetItemCount(len(w.CurrentProject().tasks))
if w.CurrentProject().isLast() {
w.Prev()
return
}
w.Next()
w.CurrentProject().index = w.Selected
w.RenderFunction()
}
/* -------------------- Unexported Functions -------------------- */