|
|
|
@ -78,13 +78,26 @@ func (ct *Cointop) sortfn(sortby string, desc bool) func(g *gocui.Gui, v *gocui.
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (ct *Cointop) getSortColIndex() int {
|
|
|
|
|
for i, col := range colorder {
|
|
|
|
|
if ct.sortby == col {
|
|
|
|
|
return i
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 0
|
|
|
|
|
func (ct *Cointop) sortAsc(g *gocui.Gui, v *gocui.View) error {
|
|
|
|
|
ct.sortdesc = false
|
|
|
|
|
ct.sort(ct.sortby, ct.sortdesc, ct.coins)
|
|
|
|
|
ct.Update(func() {
|
|
|
|
|
ct.tableview.Clear()
|
|
|
|
|
ct.updateTable()
|
|
|
|
|
})
|
|
|
|
|
ct.rowChanged()
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (ct *Cointop) sortDesc(g *gocui.Gui, v *gocui.View) error {
|
|
|
|
|
ct.sortdesc = true
|
|
|
|
|
ct.sort(ct.sortby, ct.sortdesc, ct.coins)
|
|
|
|
|
ct.Update(func() {
|
|
|
|
|
ct.tableview.Clear()
|
|
|
|
|
ct.updateTable()
|
|
|
|
|
})
|
|
|
|
|
ct.rowChanged()
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (ct *Cointop) sortPrevCol(g *gocui.Gui, v *gocui.View) error {
|
|
|
|
@ -121,3 +134,12 @@ func (ct *Cointop) sortNextCol(g *gocui.Gui, v *gocui.View) error {
|
|
|
|
|
ct.rowChanged()
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (ct *Cointop) getSortColIndex() int {
|
|
|
|
|
for i, col := range colorder {
|
|
|
|
|
if ct.sortby == col {
|
|
|
|
|
return i
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|