Skip to content

Commit bf21de4

Browse files
committed
move cancelSelection for bounding boxes to the correct place
Closes #175.
1 parent d535613 commit bf21de4

File tree

1 file changed

+3
-12
lines changed
  • imagetagger/imagetagger/annotations/static/annotations/js

1 file changed

+3
-12
lines changed

imagetagger/imagetagger/annotations/static/annotations/js/annotations.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,9 @@ function calculateImageScale() {
853853
loading.removeClass('hidden');
854854
$('#annotation_type_id').val(gAnnotationType);
855855

856+
if (tool instanceof BoundingBoxes) {
857+
tool.cancelSelection();
858+
}
856859
let loadImage = displayImage(imageId).then(scrollImageList);
857860

858861
if (!$('#keep_selection').prop('checked')) {
@@ -1192,9 +1195,6 @@ function calculateImageScale() {
11921195
let annotation = getValidAnnotation(true);
11931196
let annotationPromise = createAnnotation(annotation);
11941197
let imagePromise = loadImageList().then(r => {
1195-
if (tool instanceof BoundingBoxes) {
1196-
tool.cancelSelection();
1197-
}
11981198
return loadAdjacentImage(-1);
11991199
})
12001200
await Promise.all([annotationPromise, imagePromise]);
@@ -1203,25 +1203,16 @@ function calculateImageScale() {
12031203
}
12041204
});
12051205
$('#back_button').click(async function (event) {
1206-
if (tool instanceof BoundingBoxes) {
1207-
tool.cancelSelection();
1208-
}
12091206
await loadAdjacentImage(-1);
12101207
});
12111208
$('#skip_button').click(async function (event) {
1212-
if (tool instanceof BoundingBoxes) {
1213-
tool.cancelSelection();
1214-
}
12151209
await loadAdjacentImage(1)
12161210
});
12171211
$('#next_button').click(async function (event) {
12181212
try {
12191213
let annotation = getValidAnnotation(true);
12201214
let annotationPromise = createAnnotation(annotation);
12211215
let imagePromise = loadImageList().then(r => {
1222-
if (tool instanceof BoundingBoxes) {
1223-
tool.cancelSelection();
1224-
}
12251216
return loadAdjacentImage(1);
12261217
})
12271218
await Promise.all([annotationPromise, imagePromise]);

0 commit comments

Comments
 (0)