Skip to content

Commit

Permalink
Fix create annotation selection
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbroks committed Jan 26, 2019
1 parent b7e29ca commit c9265d2
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions client/src/components/annotator/Category.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ export default {
createAnnotation() {
let parent = this.$parent;
let categories = parent.categories;
let annotationId = this.category.annotations.length;
this.selectedAnnotation = annotationId;
this.$nextTick(() => {
this.$emit("click", {
annotation: annotationId,
category: this.index
});
});
axios
.post("/api/annotation/", {
Expand All @@ -133,8 +142,6 @@ export default {
this.category.annotations.push(response.data);
let annotationId = this.category.annotations.length - 1;
if (this.isCurrent) {
this.isVisible = true;
this.showAnnotations = true;
Expand All @@ -149,14 +156,6 @@ export default {
} else {
this.$parent.scrollElement(annotation.$el);
}
this.selectedAnnotation = annotationId;
this.$nextTick(() => {
this.$emit("click", {
annotation: annotationId,
category: this.index
});
});
});
},
/**
Expand Down

0 comments on commit c9265d2

Please sign in to comment.