Browse Source

Fix redirect problem when documents is empty after filtering

pull/897/head
Hironsan 4 years ago
parent
commit
45dd1cf520
3 changed files with 10 additions and 4 deletions
  1. 10
      frontend/components/containers/annotation/BottomNavigator.vue
  2. 2
      frontend/components/containers/annotation/Pagination.vue
  3. 2
      frontend/layouts/annotation.vue

10
frontend/components/containers/annotation/BottomNavigator.vue

@ -4,7 +4,10 @@
absolute absolute
hide-on-scroll hide-on-scroll
> >
<v-btn @click="prevPage">
<v-btn
:disabled="value===1"
@click="prevPage"
>
<span>Prev</span> <span>Prev</span>
<v-icon>mdi-chevron-left</v-icon> <v-icon>mdi-chevron-left</v-icon>
</v-btn> </v-btn>
@ -24,7 +27,10 @@
<v-icon>mdi-book-open-outline</v-icon> <v-icon>mdi-book-open-outline</v-icon>
</v-btn> --> </v-btn> -->
<v-btn @click="nextPage">
<v-btn
:disabled="value===length || length===0"
@click="nextPage"
>
<span>Next</span> <span>Next</span>
<v-icon>mdi-chevron-right</v-icon> <v-icon>mdi-chevron-right</v-icon>
</v-btn> </v-btn>

2
frontend/components/containers/annotation/Pagination.vue

@ -43,7 +43,7 @@
<template v-slot:activator="{ on }"> <template v-slot:activator="{ on }">
<v-btn <v-btn
v-shortkey.once="['arrowright']" v-shortkey.once="['arrowright']"
:disabled="value===length"
:disabled="value===length || length===0"
text text
fab fab
small small

2
frontend/layouts/annotation.vue

@ -162,7 +162,7 @@ export default {
watch: { watch: {
total() { total() {
// To validate the range of page variable on reloading the annotation page. // To validate the range of page variable on reloading the annotation page.
if (this.page > this.total) {
if (this.total !== 0 && this.page > this.total) {
this.$router.push({ this.$router.push({
path: `/projects/${this.$route.params.id}/` path: `/projects/${this.$route.params.id}/`
}) })

Loading…
Cancel
Save