From ff65d27eca240fb2d9714ad8ddce87fac4f4138c Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Mon, 29 Jul 2019 16:04:20 -0400 Subject: [PATCH] Further fix up pagination styles and interactions for Cake 3 - specifically fix up page size form control (CO-1764) --- app/src/Template/Element/pagination.ctp | 8 +++++--- app/webroot/css/co-base.css | 8 ++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/src/Template/Element/pagination.ctp b/app/src/Template/Element/pagination.ctp index 84f81ae34..ec485f31c 100644 --- a/app/src/Template/Element/pagination.ctp +++ b/app/src/Template/Element/pagination.ctp @@ -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; diff --git a/app/webroot/css/co-base.css b/app/webroot/css/co-base.css index 22bd67341..8c1b86921 100644 --- a/app/webroot/css/co-base.css +++ b/app/webroot/css/co-base.css @@ -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;