|
|
|
|
@ -95,14 +95,16 @@ export default class extends ApplicationController {
|
|
|
|
|
|
|
|
|
|
if (annotations_attributes.length > 0) { |
|
|
|
|
$.each(annotations_attributes, function(index, annotation) { |
|
|
|
|
$.post("/api/doctrines/" + doctrine.id + "/annotations", annotation, function(annotation, status) { |
|
|
|
|
$.post("/api/doctrines/" + doctrine.id + "/annotations", annotation, function(result, status) { |
|
|
|
|
if(status === 'success') { |
|
|
|
|
$('.toast').addClass('bg-success').show(); |
|
|
|
|
$( ".toast-body" ).html( "<span><b>Case Lists was successfully save</b></span>" ); |
|
|
|
|
$('.toast').fadeOut(5000); |
|
|
|
|
|
|
|
|
|
if (index === annotations_attributes.length - 1) { |
|
|
|
|
location.pathname = "/documents/" + document_id + "/doctrines/" + doctrine.id |
|
|
|
|
$(window).delay(5000).queue(function() { |
|
|
|
|
location.pathname = "/documents/" + document_id + "/doctrines/" + doctrine.id |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|