Skip to content

update delete url on image change (fixes #108) #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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