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:
@@ -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 -------------------- */
|
||||
|
||||
Reference in New Issue
Block a user