Skip to content

Commit

Permalink
Merge pull request #413 from carloslancha/FixClayPagination
Browse files Browse the repository at this point in the history
Fix ClayPagination range when current page is last page
  • Loading branch information
jbalsas authored Jan 16, 2018
2 parents 8b4b107 + 80711b1 commit d0f2148
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 91 deletions.
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

0 comments on commit d0f2148

Please sign in to comment.