Skip to content

Commit b64f755

Browse files
committed
update delete url on image change (fixes #108)
1 parent 2936063 commit b64f755

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ function calculateImageScale() {
3535
const FEEDBACK_DISPLAY_TIME = 3000;
3636
const ANNOTATE_URL = '/annotations/%s/';
3737
const IMAGE_SET_URL = '/images/imageset/%s/';
38+
const DELETE_IMAGE_URL = '/images/image/delete/%s/';
3839
const PRELOAD_BACKWARD = 2;
3940
const PRELOAD_FORWARD = 5;
4041
const STATIC_ROOT = '/static/';
@@ -896,6 +897,7 @@ function calculateImageScale() {
896897
next_image_id = gImageList[0];
897898
}
898899
$('#next-image-id').attr('value', next_image_id || '');
900+
$('#delete-image-form').attr('action', DELETE_IMAGE_URL.replace('%s', imageId));
899901
tool.restoreSelection(false);
900902

901903
if (fromHistory !== true) {

imagetagger/imagetagger/annotations/templates/annotations/annotate.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ <h4 class="modal-title" id="myModalLabel">
242242
Do you really want to permanently delete this image from the imageset?
243243
</div>
244244
<div class="modal-footer">
245-
<form method="post" action="{% url 'images:delete_images' selected_image.id %}">
245+
<form id="delete-image-form" method="post" action="{% url 'images:delete_images' selected_image.id %}">
246246
{% csrf_token %}
247247
<input id="next-image-id" type="hidden" name="next-image-id" value="{{ set_images.first.id }}">
248248
<div class="input-group" role="group" aria-label="delete-image">

0 commit comments

Comments
 (0)