Browse Source

Merge pull request #129 from lexintegritastech/improve-main-ui

Add delay after saving `doctrines`
pull/130/head
Alexander D. Bondoc 4 years ago committed by GitHub
parent
commit
c7c72c5ee7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/javascript/controllers/doctrines_controller.js

4
app/javascript/controllers/doctrines_controller.js

@ -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) {
$(window).delay(5000).queue(function() {
location.pathname = "/documents/" + document_id + "/doctrines/" + doctrine.id
})
}
}
})

Loading…
Cancel
Save