Browse Source

Inline getAnnotations function

pull/489/head
Clemens Wolff 5 years ago
parent
commit
c9d12e6cb2
1 changed files with 3 additions and 5 deletions
  1. 8
      app/server/static/components/document_classification.vue

8
app/server/static/components/document_classification.vue

@ -58,10 +58,6 @@ export default {
mixins: [annotationMixin],
methods: {
getAnnotation(label) {
return this.annotations[this.pageNumber].find(annotation => annotation.label === label.id);
},
async submit() {
const state = this.getState();
this.url = `docs?q=${this.searchQuery}&doc_annotations__isnull=${state}&offset=${this.offset}&ordering=${this.ordering}`;
@ -70,7 +66,9 @@ export default {
},
async addLabel(label) {
const annotation = this.getAnnotation(label);
const annotations = this.annotations[this.pageNumber];
const annotation = annotations.find(item => item.label === label.id);
if (annotation) {
this.removeLabel(annotation);
} else {

Loading…
Cancel
Save