Skip to content

Commit

Permalink
Show pagination buttons only if usable (#775)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrahn committed Aug 31, 2023
1 parent c4649b0 commit 6c77927
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions vueapp/components/PaginationButtons.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="oc--pagination">
<div class="oc--pagination" v-if="showPagination">
<button v-if="paging.lastPage >= 0"
v-bind:disabled="paging.currPage <= 0"
@click="setPage(paging.currPage-1)"
Expand Down Expand Up @@ -46,14 +46,14 @@
v-model="limit"
:title="$gettext('Videos pro Seite')"
>
<option value="5">5</option>
<option :value="minPaginationLimit">{{minPaginationLimit}}</option>
<option value="15">15</option>
<option value="30">30</option>
<option value="50">50</option>
</select>
</div>

<div class="oc--pagination-mobile">
<div class="oc--pagination-mobile" v-if="showPagination">
<button v-if="paging.lastPage >= 0"
v-bind:disabled="paging.currPage <= 0"
@click="setPage(0)"
Expand Down Expand Up @@ -102,7 +102,7 @@
v-model="limit"
:title="$gettext('Videos pro Seite')"
>
<option value="5">5</option>
<option :value="minPaginationLimit">{{minPaginationLimit}}</option>
<option value="15">15</option>
<option value="30">30</option>
<option value="50">50</option>
Expand All @@ -126,7 +126,8 @@ export default {
data() {
return {
limit: 15
limit: 15,
minPaginationLimit: 5
}
},
Expand Down Expand Up @@ -184,6 +185,10 @@ export default {
}
return numbers;
},
showPagination() {
return this.paging.items > this.minPaginationLimit;
}
},
Expand Down

0 comments on commit 6c77927

Please sign in to comment.