Skip to content

Commit

Permalink
FIX: Don't show pagination when unnecessary (#138)
Browse files Browse the repository at this point in the history
closes #138
  • Loading branch information
dwhieb committed Jul 13, 2024
1 parent fddc452 commit e292c99
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions pages/Search/Search.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
{{> em-dash/em-dash }}
</div>

{{> Search/components/pagination/pagination }}
{{#if pagination.show }}
{{> Search/components/pagination/pagination }}
{{/if}}

<div aria-labelledby=results-caption class='results-wrapper scroll-shadow' role=region tabindex=0>
<table class=results>
Expand Down Expand Up @@ -118,7 +120,9 @@
</table>
</div>

{{> Search/components/pagination/pagination }}
{{#if pagination.show }}
{{> Search/components/pagination/pagination }}
{{/if}}

<section class='citation sticky'>

Expand Down
1 change: 1 addition & 0 deletions pages/Search/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export function Search(req, res) {
},
nextPages,
prevPages,
show: allResults.length > limit,
startIndex: (offset + 1).toLocaleString(),
},
results,
Expand Down
2 changes: 1 addition & 1 deletion pages/Search/components/pagination/pagination.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<a href='{{ link }}'>{{#if jump }}{{else}}{{ pageNum }}{{/if}}</a>
</li>
{{/each}}
{{#unless (is endIndex totalResults) }}
{{#unless (is endIndex ../totalResults) }}
<li>
<a href='{{ links.nextPage }}'>
<span aria-hidden=true>›</span>
Expand Down

0 comments on commit e292c99

Please sign in to comment.