Skip to content

Commit c9265d2

Browse files
committed
Fix create annotation selection
1 parent b7e29ca commit c9265d2

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

client/src/components/annotator/Category.vue

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,15 @@ export default {
118118
createAnnotation() {
119119
let parent = this.$parent;
120120
let categories = parent.categories;
121+
let annotationId = this.category.annotations.length;
122+
123+
this.selectedAnnotation = annotationId;
124+
this.$nextTick(() => {
125+
this.$emit("click", {
126+
annotation: annotationId,
127+
category: this.index
128+
});
129+
});
121130
122131
axios
123132
.post("/api/annotation/", {
@@ -133,8 +142,6 @@ export default {
133142
134143
this.category.annotations.push(response.data);
135144
136-
let annotationId = this.category.annotations.length - 1;
137-
138145
if (this.isCurrent) {
139146
this.isVisible = true;
140147
this.showAnnotations = true;
@@ -149,14 +156,6 @@ export default {
149156
} else {
150157
this.$parent.scrollElement(annotation.$el);
151158
}
152-
153-
this.selectedAnnotation = annotationId;
154-
this.$nextTick(() => {
155-
this.$emit("click", {
156-
annotation: annotationId,
157-
category: this.index
158-
});
159-
});
160159
});
161160
},
162161
/**

0 commit comments

Comments
 (0)