Browse Source

Adding keyboard shortcut for approval button

pull/980/head
Collin Brown 4 years ago
parent
commit
cff6880582
2 changed files with 20 additions and 0 deletions
  1. 18
      frontend/components/containers/annotation/ApproveButton.vue
  2. 2
      frontend/layouts/annotation.vue

18
frontend/components/containers/annotation/ApproveButton.vue

@ -2,11 +2,13 @@
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-btn
v-shortkey.once="['a']"
:disabled="disabled"
class="text-capitalize ps-1 pe-1"
min-width="36"
outlined
v-on="on"
@shortkey="approveNextPage"
@click="approveDocument"
>
<v-icon v-if="approved">
@ -35,6 +37,16 @@ export default {
disabled: {
type: Boolean,
default: false
},
value: {
type: Number,
default: 1,
required: true
},
length: {
type: Number,
default: 1,
required: true
}
},
@ -44,6 +56,12 @@ export default {
this.approve({
projectId: this.$route.params.id
})
},
/** Approves document and moves to the next page */
approveNextPage() {
const page = Math.min(this.value + 1, this.length)
this.$emit('input', page)
this.approveDocument()
}
}
}

2
frontend/layouts/annotation.vue

@ -30,6 +30,8 @@
<v-col>
<approve-button
v-if="canViewApproveButton"
v-model="page"
:length="total"
:approved="approved"
:disabled="currentDoc ? false : true"
/>

Loading…
Cancel
Save