From e8247bf14b1f66344d7764c4efc21da3a5e1401c Mon Sep 17 00:00:00 2001 From: Timon Engelke Date: Tue, 30 Mar 2021 13:09:33 +0200 Subject: [PATCH] move cancelSelection for bounding boxes to the correct place Closes #175. --- .../static/annotations/js/annotations.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/imagetagger/imagetagger/annotations/static/annotations/js/annotations.js b/imagetagger/imagetagger/annotations/static/annotations/js/annotations.js index 3501c71f..0b3e6bcd 100644 --- a/imagetagger/imagetagger/annotations/static/annotations/js/annotations.js +++ b/imagetagger/imagetagger/annotations/static/annotations/js/annotations.js @@ -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')) { @@ -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]); @@ -1204,15 +1204,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) { @@ -1220,9 +1214,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]);