Merge pull request #13 from oqtane/master

sync with upstream
This commit is contained in:
Shaun Walker 2019-10-25 14:19:56 -04:00 committed by GitHub
commit d5031a052a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,7 +44,7 @@
@code { @code {
int Pages = 0; int Pages = 0;
int Page; int Page = 1;
int MaxItems; int MaxItems;
int MaxPages; int MaxPages;
int StartPage; int StartPage;
@ -85,7 +85,6 @@
{ {
MaxPages = int.Parse(DisplayPages); MaxPages = int.Parse(DisplayPages);
} }
Page = 1;
if (Items != null) if (Items != null)
{ {
@ -107,7 +106,15 @@
{ {
if (direction == "forward") if (direction == "forward")
{ {
StartPage = EndPage + 1; if (EndPage + 1 < Pages)
{
StartPage = EndPage + 1;
}
else
{
StartPage = 1;
}
if (EndPage + MaxPages < Pages) if (EndPage + MaxPages < Pages)
{ {
EndPage = StartPage + MaxPages - 1; EndPage = StartPage + MaxPages - 1;