From b05e101e7e4bf2567db79f318baf3d961caccf63 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 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]);