mirror of
https://github.com/Maks1mS/bubbles.git
synced 2024-12-24 14:44:38 +03:00
Return the value of paginator.TotalPages in SetTotalPages...
when the given number of items is below 1.
This commit is contained in:
parent
97020cd0d2
commit
7d1c04164e
@ -40,8 +40,8 @@ type Model struct {
|
|||||||
// used for other things beyond navigating sets. Note that it both returns the
|
// used for other things beyond navigating sets. Note that it both returns the
|
||||||
// number of total pages and alters the model.
|
// number of total pages and alters the model.
|
||||||
func (m *Model) SetTotalPages(items int) int {
|
func (m *Model) SetTotalPages(items int) int {
|
||||||
if items == 0 {
|
if items < 1 {
|
||||||
return 0
|
return m.TotalPages
|
||||||
}
|
}
|
||||||
n := items / m.PerPage
|
n := items / m.PerPage
|
||||||
if items%m.PerPage > 0 {
|
if items%m.PerPage > 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user