Skip to content

Commit

Permalink
update delete url on image change (fixes #108)
Browse files Browse the repository at this point in the history
  • Loading branch information
timonegk committed Dec 12, 2020
1 parent 2936063 commit b64f755
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function calculateImageScale() {
const FEEDBACK_DISPLAY_TIME = 3000;
const ANNOTATE_URL = '/annotations/%s/';
const IMAGE_SET_URL = '/images/imageset/%s/';
const DELETE_IMAGE_URL = '/images/image/delete/%s/';
const PRELOAD_BACKWARD = 2;
const PRELOAD_FORWARD = 5;
const STATIC_ROOT = '/static/';
Expand Down Expand Up @@ -896,6 +897,7 @@ function calculateImageScale() {
next_image_id = gImageList[0];
}
$('#next-image-id').attr('value', next_image_id || '');
$('#delete-image-form').attr('action', DELETE_IMAGE_URL.replace('%s', imageId));
tool.restoreSelection(false);

if (fromHistory !== true) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ <h4 class="modal-title" id="myModalLabel">
Do you really want to permanently delete this image from the imageset?
</div>
<div class="modal-footer">
<form method="post" action="{% url 'images:delete_images' selected_image.id %}">
<form id="delete-image-form" method="post" action="{% url 'images:delete_images' selected_image.id %}">
{% csrf_token %}
<input id="next-image-id" type="hidden" name="next-image-id" value="{{ set_images.first.id }}">
<div class="input-group" role="group" aria-label="delete-image">
Expand Down

0 comments on commit b64f755

Please sign in to comment.