Skip to content

Commit e8247bf

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

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')) {
@@ -1193,9 +1196,6 @@ function calculateImageScale() {
11931196
let annotation = getValidAnnotation(true);
11941197
let annotationPromise = createAnnotation(annotation);
11951198
let imagePromise = loadImageList().then(r => {
1196-
if (tool instanceof BoundingBoxes) {
1197-
tool.cancelSelection();
1198-
}
11991199
return loadAdjacentImage(-1);
12001200
})
12011201
await Promise.all([annotationPromise, imagePromise]);
@@ -1204,25 +1204,16 @@ function calculateImageScale() {
12041204
}
12051205
});
12061206
$('#back_button').click(async function (event) {
1207-
if (tool instanceof BoundingBoxes) {
1208-
tool.cancelSelection();
1209-
}
12101207
await loadAdjacentImage(-1);
12111208
});
12121209
$('#skip_button').click(async function (event) {
1213-
if (tool instanceof BoundingBoxes) {
1214-
tool.cancelSelection();
1215-
}
12161210
await loadAdjacentImage(1)
12171211
});
12181212
$('#next_button').click(async function (event) {
12191213
try {
12201214
let annotation = getValidAnnotation(true);
12211215
let annotationPromise = createAnnotation(annotation);
12221216
let imagePromise = loadImageList().then(r => {
1223-
if (tool instanceof BoundingBoxes) {
1224-
tool.cancelSelection();
1225-
}
12261217
return loadAdjacentImage(1);
12271218
})
12281219
await Promise.all([annotationPromise, imagePromise]);

0 commit comments

Comments
 (0)