Skip to content

Commit

Permalink
Further fix up pagination styles and interactions for Cake 3 - specif…
Browse files Browse the repository at this point in the history
…ically fix up page size form control (CO-1764)
  • Loading branch information
arlen committed Jul 29, 2019
1 parent cbf75fd commit ff65d27
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 5 additions & 3 deletions app/src/Template/Element/pagination.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,14 @@
// Default is 25 records, current maximum is 100.
// For now we will simply hard-code the options from 25 - 100.

print $this->Form->create(null, [ 'type' => 'get' ]);
print $this->Form->create(null, [ 'type' => 'get', 'class' => 'pagination-form' ]);

// This is similar to Paginator->limitControl, but we have to manually
// re-insert query params that we want to maintain through the limit adjustment

$queryParams = ['page', 'sort', 'direct'];

// Note: we specifically do NOT retain the 'page' param, because we should always go
// back to page one when using this form; otherwise we can easily get a page/limit mismatch that breaks.
$queryParams = ['sort', 'direct'];

if(!empty($vv_primary_link)) {
$queryParams[] = $vv_primary_link;
Expand Down
8 changes: 6 additions & 2 deletions app/webroot/css/co-base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1100,9 +1100,13 @@ body.co_petitions .ui-dialog {
text-align: center;
}
#pagination .pagination-form select {
margin: 0;
padding: 0;
margin: 0 0.5rem;
padding: 0 0.25rem;
font-size: 0.9em;
display: inline-block;
line-height: unset;
width: unset;
height: unset;
}
#pagination .pagination-form option {
padding: 0;
Expand Down

0 comments on commit ff65d27

Please sign in to comment.