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 828a8dc commit b05e101
Showing 1 changed file with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,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 @@ -1194,9 +1197,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 @@ -1205,25 +1205,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 b05e101

Please sign in to comment.