File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
client/src/components/annotator Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff 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 /**
You can’t perform that action at this time.
0 commit comments