Skip to content

Commit 421dd84

Browse files
committed
cleanup setting of blurred/concealed check boxes
1 parent 7267ec7 commit 421dd84

File tree

3 files changed

+9
-26
lines changed

3 files changed

+9
-26
lines changed

imagetagger/imagetagger/annotations/static/annotations/js/annotations.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,8 @@ function calculateImageScale() {
521521
gEditAnnotationId = undefined;
522522
$('.annotation').removeClass('alert-info');
523523
$('#edit_active').addClass('hidden');
524+
$('#concealed').prop('checked', false);
525+
$('#blurred').prop('checked', false);
524526
}
525527

526528
/**
@@ -821,11 +823,6 @@ function calculateImageScale() {
821823

822824
let loadImage = displayImage(imageId);
823825

824-
if (!$('#keep_selection').prop('checked')) {
825-
$('#concealed').prop('checked', false);
826-
$('#blurred').prop('checked', false);
827-
}
828-
829826
$('.annotate_image_link').removeClass('active');
830827
let link = $('#annotate_image_link_' + imageId);
831828
link.addClass('active');
@@ -838,8 +835,14 @@ function calculateImageScale() {
838835
$('#delete-image-form').attr('action', DELETE_IMAGE_URL.replace('%s', imageId));
839836

840837
tool.clear();
841-
if (globals.restoreSelection !== undefined) {
838+
if (globals.restoreSelection !== undefined && $('#keep_selection').prop('checked')) {
842839
tool.restoreSelection();
840+
if (globals.restoreSelection === null) {
841+
// not in image
842+
$('#not_in_image').prop('checked', true);
843+
$('#coordinate_table').hide();
844+
setupCBCheckboxes();
845+
}
843846
} else {
844847
resetSelection();
845848
}

imagetagger/imagetagger/annotations/static/annotations/js/boundingboxes.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,8 @@ class BoundingBoxes {
150150
* Restore the selection.
151151
*/
152152
restoreSelection() {
153-
if (!$('#keep_selection').prop('checked')) {
154-
return;
155-
}
156153
if (globals.restoreSelection !== undefined) {
157154
if (globals.restoreSelection === null) {
158-
$('#not_in_image').prop('checked', true);
159-
$('#coordinate_table').hide();
160155
} else {
161156
$('#x1Field').val(globals.restoreSelection.x1);
162157
$('#x2Field').val(globals.restoreSelection.x2);

imagetagger/imagetagger/annotations/static/annotations/js/canvas.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -572,23 +572,8 @@ class Canvas {
572572
* Restore the selection.
573573
*/
574574
restoreSelection() {
575-
if (!$('#keep_selection').prop('checked')) {
576-
return;
577-
}
578575
if (globals.restoreSelection !== undefined) {
579576
if (globals.restoreSelection === null) {
580-
$('#not_in_image').prop('checked', true);
581-
$('#coordinate_table').hide();
582-
let concealed = $('#concealed');
583-
let concealedP = $('#concealed_p');
584-
let blurred = $('#blurred');
585-
let blurredP = $('#blurred_p');
586-
concealedP.hide();
587-
concealed.prop('checked', false);
588-
concealed.prop('disabled', true);
589-
blurredP.hide();
590-
blurred.prop('checked', false);
591-
blurred.prop('disabled', true);
592577
} else if (globals.restoreSelectionVectorType === 4) {
593578
// this is not implemented for multilines, so just do nothing
594579
this.old = undefined;

0 commit comments

Comments
 (0)