PageIndexWidget: show first applicable wildcard link in responsive mode

This commit is contained in:
Aaron van Geffen 2023-11-20 22:27:57 +01:00
parent 56f21a6721
commit f143b2ddcf
2 changed files with 9 additions and 2 deletions

View File

@ -92,13 +92,16 @@ a:hover {
.pagination .page-link { .pagination .page-link {
border-radius: var(--bs-pagination-border-radius) !important; border-radius: var(--bs-pagination-border-radius) !important;
} }
.pagination > :first-child, .pagination > :last-child { .pagination > :first-child, .pagination > :last-child, .pagination .first-wildcard {
display: inline-block; display: inline-block;
position: absolute; position: absolute;
} }
.pagination > :first-child { .pagination > :first-child {
left: 0; left: 0;
} }
.pagination > .first-wildcard {
left: 48%;
}
.pagination > :last-child { .pagination > :last-child {
right: 0; right: 0;
} }

View File

@ -47,9 +47,13 @@ class PageIndexWidget extends Template
if (!is_array($page)) if (!is_array($page))
{ {
$first_wildcard = $num_wildcards === 0;
$num_wildcards++; $num_wildcards++;
echo ' echo '
<li class="page-item page-padding wildcard" onclick="javascript:promptGoToPage(', self::$unique_index_count, ')"><a class="page-link">...</a></li>'; <li class="page-item page-padding wildcard',
$first_wildcard ? ' first-wildcard' : '',
'" onclick="javascript:promptGoToPage(',
self::$unique_index_count, ')"><a class="page-link">...</a></li>';
} }
else else
echo ' echo '