Cleaned up pagination calculations
This commit is contained in:
parent
1e11515b58
commit
30eead7e2f
|
@ -17,7 +17,7 @@ var (
|
|||
)
|
||||
|
||||
const (
|
||||
Version string = "0.59.2"
|
||||
Version string = "0.59.3"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -692,8 +692,11 @@ func serveDebugHtml(args []string, index *Index, paginate bool) httprouter.Handl
|
|||
}
|
||||
if pageLength != 0 {
|
||||
nextPage := page + 1
|
||||
if nextPage > (fileCount / int(pageLength)) {
|
||||
|
||||
if nextPage > (fileCount/int(pageLength)) && fileCount%int(pageLength) == 0 {
|
||||
nextPage = fileCount / int(pageLength)
|
||||
} else if nextPage > (fileCount / int(pageLength)) {
|
||||
nextPage = (fileCount / int(pageLength)) + 1
|
||||
}
|
||||
|
||||
prevPage := page - 1
|
||||
|
|
Loading…
Reference in New Issue