Skip to content

Commit

Permalink
move cancelSelection for bounding boxes to the correct place
Browse files Browse the repository at this point in the history
Closes #175.
  • Loading branch information
timonegk committed Mar 30, 2021
1 parent badf574 commit e8247bf
Showing 1 changed file with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,9 @@ function calculateImageScale() {
loading.removeClass('hidden');
$('#annotation_type_id').val(gAnnotationType);

if (tool instanceof BoundingBoxes) {
tool.cancelSelection();
}
let loadImage = displayImage(imageId).then(scrollImageList);

if (!$('#keep_selection').prop('checked')) {
Expand Down Expand Up @@ -1193,9 +1196,6 @@ function calculateImageScale() {
let annotation = getValidAnnotation(true);
let annotationPromise = createAnnotation(annotation);
let imagePromise = loadImageList().then(r => {
if (tool instanceof BoundingBoxes) {
tool.cancelSelection();
}
return loadAdjacentImage(-1);
})
await Promise.all([annotationPromise, imagePromise]);
Expand All @@ -1204,25 +1204,16 @@ function calculateImageScale() {
}
});
$('#back_button').click(async function (event) {
if (tool instanceof BoundingBoxes) {
tool.cancelSelection();
}
await loadAdjacentImage(-1);
});
$('#skip_button').click(async function (event) {
if (tool instanceof BoundingBoxes) {
tool.cancelSelection();
}
await loadAdjacentImage(1)
});
$('#next_button').click(async function (event) {
try {
let annotation = getValidAnnotation(true);
let annotationPromise = createAnnotation(annotation);
let imagePromise = loadImageList().then(r => {
if (tool instanceof BoundingBoxes) {
tool.cancelSelection();
}
return loadAdjacentImage(1);
})
await Promise.all([annotationPromise, imagePromise]);
Expand Down

0 comments on commit e8247bf

Please sign in to comment.