add function to update board mode
This commit is contained in:
parent
70238291e7
commit
04f76daae9
2 changed files with 9 additions and 5 deletions
|
@ -49,8 +49,7 @@ func (a *App) move() {
|
|||
if a.mode == normal {
|
||||
a.statusSelection.cardID = a.focusedCardID()
|
||||
a.statusSelection.currentStatusID = a.focusedStatusID()
|
||||
a.mode = selection
|
||||
a.modeView.update(a.mode)
|
||||
a.updateBoardMode(selection)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -120,14 +119,13 @@ func (a *App) selected() {
|
|||
}
|
||||
|
||||
a.statusSelection = statusSelection{0, 0, 0}
|
||||
a.mode = normal
|
||||
a.updateBoardMode(normal)
|
||||
a.refresh(false)
|
||||
}
|
||||
}
|
||||
|
||||
func (a *App) escape() {
|
||||
if a.mode != normal {
|
||||
a.mode = normal
|
||||
a.modeView.update(a.mode)
|
||||
a.updateBoardMode(normal)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -270,6 +270,12 @@ func (a *App) boardMode() boardMode {
|
|||
return a.mode
|
||||
}
|
||||
|
||||
// updateBoardMode updates the board mode.
|
||||
func (a *App) updateBoardMode(mode boardMode) {
|
||||
a.mode = mode
|
||||
a.modeView.update(mode)
|
||||
}
|
||||
|
||||
// focusedCardID returns the ID of the card in focus.
|
||||
func (a *App) focusedCardID() int {
|
||||
focusedCard := a.columns[a.focusedColumn].focusedCard
|
||||
|
|
Loading…
Reference in a new issue