From c9265d29597457cc0dd898204fae87df2d1052ed Mon Sep 17 00:00:00 2001 From: Justin Brooks Date: Fri, 25 Jan 2019 21:39:50 -0500 Subject: [PATCH] Fix create annotation selection --- client/src/components/annotator/Category.vue | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/client/src/components/annotator/Category.vue b/client/src/components/annotator/Category.vue index b706c096..1d5ceffd 100755 --- a/client/src/components/annotator/Category.vue +++ b/client/src/components/annotator/Category.vue @@ -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/", { @@ -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; @@ -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 - }); - }); }); }, /**