web: fix pagination not working correctly sometimes, fix pagination not showing when changing pages

This commit is contained in:
Jens Langhammer
2021-02-04 10:08:57 +01:00
parent 178417fe67
commit 9ca9e67ffa
3 changed files with 9 additions and 9 deletions

View File

@ -1,6 +1,7 @@
import { CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element";
import { COMMON_STYLES } from "../../common/styles";
import { PBPagination } from "../../api/Client";
import { gettext } from "django";
@customElement("ak-table-pagination")
export class TablePagination extends LitElement {
@ -32,8 +33,8 @@ export class TablePagination extends LitElement {
<button
class="pf-c-button pf-m-plain"
@click=${() => { this.pageChangeHandler(this.pages?.previous || 0); }}
?disabled="${(this.pages?.previous || 0) > 0}"
aria-label="{% trans 'Go to previous page' %}"
?disabled="${(this.pages?.previous || 0) < 1}"
aria-label="${gettext("Go to previous page")}"
>
<i class="fas fa-angle-left" aria-hidden="true"></i>
</button>
@ -42,8 +43,8 @@ export class TablePagination extends LitElement {
<button
class="pf-c-button pf-m-plain"
@click=${() => { this.pageChangeHandler(this.pages?.next || 0); }}
?disabled="${(this.pages?.next || 0) > 0}"
aria-label="{% trans 'Go to next page' %}"
?disabled="${(this.pages?.next || 0) < 0}"
aria-label="${gettext("Go to next page")}"
>
<i class="fas fa-angle-right" aria-hidden="true"></i>
</button>