diff --git a/imagetagger/imagetagger/annotations/static/annotations/js/annotations.js b/imagetagger/imagetagger/annotations/static/annotations/js/annotations.js index 3fb85399..c273441e 100644 --- a/imagetagger/imagetagger/annotations/static/annotations/js/annotations.js +++ b/imagetagger/imagetagger/annotations/static/annotations/js/annotations.js @@ -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')) { @@ -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]); @@ -1205,15 +1205,9 @@ 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) { @@ -1221,9 +1215,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]);