Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ClayPagination range when current page is last page #413

Merged
merged 2 commits into from
Jan 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/clay-pagination/src/ClayPagination.soy
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
{else}
{call .range}
{param baseHref: $baseHref /}
{param endPage: $currentPage == $totalPages ? $currentPage : $currentPage - 1 /}
{param endPage: $currentPage == $totalPages ? $currentPage - 3 : $currentPage - 1 /}
{param initPage: 2 /}
{/call}
{/if}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -726,15 +726,6 @@ exports[`ClayPagination should render a ClayPagination with 6 total pages and pa
<li>
<a class=" dropdown-item" href="#2">2</a>
</li>
<li>
<a class=" dropdown-item" href="#3">3</a>
</li>
<li>
<a class=" dropdown-item" href="#4">4</a>
</li>
<li>
<a class=" dropdown-item" href="#5">5</a>
</li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -1086,15 +1077,6 @@ exports[`ClayPagination should render a ClayPagination with 7 total pages and pa
<li>
<a class=" dropdown-item" href="#3">3</a>
</li>
<li>
<a class=" dropdown-item" href="#4">4</a>
</li>
<li>
<a class=" dropdown-item" href="#5">5</a>
</li>
<li>
<a class=" dropdown-item" href="#6">6</a>
</li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -1530,15 +1512,6 @@ exports[`ClayPagination should render a ClayPagination with 8 total pages and pa
<li>
<a class=" dropdown-item" href="#4">4</a>
</li>
<li>
<a class=" dropdown-item" href="#5">5</a>
</li>
<li>
<a class=" dropdown-item" href="#6">6</a>
</li>
<li>
<a class=" dropdown-item" href="#7">7</a>
</li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -2064,15 +2037,6 @@ exports[`ClayPagination should render a ClayPagination with 9 total pages and pa
<li>
<a class=" dropdown-item" href="#5">5</a>
</li>
<li>
<a class=" dropdown-item" href="#6">6</a>
</li>
<li>
<a class=" dropdown-item" href="#7">7</a>
</li>
<li>
<a class=" dropdown-item" href="#8">8</a>
</li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -2694,15 +2658,6 @@ exports[`ClayPagination should render a ClayPagination with 10 total pages and p
<li>
<a class=" dropdown-item" href="#6">6</a>
</li>
<li>
<a class=" dropdown-item" href="#7">7</a>
</li>
<li>
<a class=" dropdown-item" href="#8">8</a>
</li>
<li>
<a class=" dropdown-item" href="#9">9</a>
</li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -3456,15 +3411,6 @@ exports[`ClayPagination should render a ClayPagination with baseHref, 6 total pa
<li>
<a class=" dropdown-item" href="#mySite?curPage=2">2</a>
</li>
<li>
<a class=" dropdown-item" href="#mySite?curPage=3">3</a>
</li>
<li>
<a class=" dropdown-item" href="#mySite?curPage=4">4</a>
</li>
<li>
<a class=" dropdown-item" href="#mySite?curPage=5">5</a>
</li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -3816,15 +3762,6 @@ exports[`ClayPagination should render a ClayPagination with baseHref, 7 total pa
<li>
<a class=" dropdown-item" href="#mySite?curPage=3">3</a>
</li>
<li>
<a class=" dropdown-item" href="#mySite?curPage=4">4</a>
</li>
<li>
<a class=" dropdown-item" href="#mySite?curPage=5">5</a>
</li>
<li>
<a class=" dropdown-item" href="#mySite?curPage=6">6</a>
</li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -4260,15 +4197,6 @@ exports[`ClayPagination should render a ClayPagination with baseHref, 8 total pa
<li>
<a class=" dropdown-item" href="#mySite?curPage=4">4</a>
</li>
<li>
<a class=" dropdown-item" href="#mySite?curPage=5">5</a>
</li>
<li>
<a class=" dropdown-item" href="#mySite?curPage=6">6</a>
</li>
<li>
<a class=" dropdown-item" href="#mySite?curPage=7">7</a>
</li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -4794,15 +4722,6 @@ exports[`ClayPagination should render a ClayPagination with baseHref, 9 total pa
<li>
<a class=" dropdown-item" href="#mySite?curPage=5">5</a>
</li>
<li>
<a class=" dropdown-item" href="#mySite?curPage=6">6</a>
</li>
<li>
<a class=" dropdown-item" href="#mySite?curPage=7">7</a>
</li>
<li>
<a class=" dropdown-item" href="#mySite?curPage=8">8</a>
</li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -5424,15 +5343,6 @@ exports[`ClayPagination should render a ClayPagination with baseHref, 10 total p
<li>
<a class=" dropdown-item" href="#mySite?curPage=6">6</a>
</li>
<li>
<a class=" dropdown-item" href="#mySite?curPage=7">7</a>
</li>
<li>
<a class=" dropdown-item" href="#mySite?curPage=8">8</a>
</li>
<li>
<a class=" dropdown-item" href="#mySite?curPage=9">9</a>
</li>
</ul>
</div>
</div>
Expand Down