mirror of
https://github.com/zadam/trilium.git
synced 2026-02-19 12:14:23 +01:00
ui/pager: improve layout
This commit is contained in:
parent
7964bd3be4
commit
782cd59407
@ -19,9 +19,12 @@
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-around;
|
||||
/* Prevent the prev/next buttons from shifting when ellipses appear or disappear */
|
||||
min-width: calc(var(--note-list-pager-page-button-count) * var(--note-list-pager-page-button-width)
|
||||
+ (var(--note-list-pager-ellipsis-width) * 2));
|
||||
|
||||
&.note-list-pager-ellipsis-present {
|
||||
/* Prevent the prev/next buttons from shifting when ellipses appear or disappear */
|
||||
min-width: calc(var(--note-list-pager-page-button-count) * var(--note-list-pager-page-button-width)
|
||||
+ (var(--note-list-pager-ellipsis-width) * 2));
|
||||
}
|
||||
|
||||
.note-list-pager-page-button {
|
||||
min-width: var(--note-list-pager-page-button-width);
|
||||
|
||||
@ -76,8 +76,12 @@ function PageButtons(props: PageButtonsProps) {
|
||||
const rightStart = props.pageCount - rightLength + 1;
|
||||
middleStart = Math.min(middleStart, rightStart - middleLength);
|
||||
|
||||
return <div class="note-list-pager-page-button-container"
|
||||
style={{"--note-list-pager-page-button-count": leftLength + middleLength + rightLength}}>
|
||||
const totalButtonCount = leftLength + middleLength + rightLength;
|
||||
|
||||
return <div className={clsx("note-list-pager-page-button-container", {
|
||||
"note-list-pager-ellipsis-present": (totalButtonCount === maxButtonCount)
|
||||
})}
|
||||
style={{"--note-list-pager-page-button-count": totalButtonCount}}>
|
||||
{[
|
||||
...createSegment(leftStart, leftLength, props.page, props.setPage, false),
|
||||
...createSegment(middleStart, middleLength, props.page, props.setPage, (middleStart - leftLength > 1)),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user