fixes
This commit is contained in:
@@ -34,38 +34,4 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
|
||||
$("#annotation-json-toggle").click(() => { $("#annotation-json-content").toggle() });
|
||||
|
||||
// send request to change the is_private state on customSwitches toggle
|
||||
$("#save-annotations").click(function () {
|
||||
json = getJsonToolStateNoId();
|
||||
$.ajax({
|
||||
url: "{% url 'anatomy:question_save_annotation' pk=question.pk %}",
|
||||
data: {
|
||||
csrfmiddlewaretoken: "{{ csrf_token }}",
|
||||
annotation: json,
|
||||
},
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
})
|
||||
// $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly
|
||||
.done(function (data) {
|
||||
console.log(data);
|
||||
// show some message according to the response.
|
||||
// For eg. A message box showing that the status has been changed
|
||||
if (data.status == "success") {
|
||||
toastr.info('Annotations saved')
|
||||
} else {
|
||||
toastr.warning('Error saving annotations')
|
||||
}
|
||||
})
|
||||
.always(function () {
|
||||
console.log('[Done]');
|
||||
})
|
||||
})
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user