|
|
|
@ -90,7 +90,7 @@ export default class extends ApplicationController { |
|
|
|
$.post("/api/doctrines", $.extend({ jurisprudence_ids: [document_id] }, params), function(doctrine, status) { |
|
|
|
$.post("/api/doctrines", $.extend({ jurisprudence_ids: [document_id] }, params), function(doctrine, status) { |
|
|
|
if(status === 'success') { |
|
|
|
if(status === 'success') { |
|
|
|
$('.toast').addClass('bg-success').show(); |
|
|
|
$('.toast').addClass('bg-success').show(); |
|
|
|
$( ".toast-body" ).html( "<span><b>Doctrine was successfully save</b></span>" ); |
|
|
|
$( ".toast-body" ).html( "<span><b>Doctrine was successfully saved</b></span>" ); |
|
|
|
$('.toast').fadeOut(5000); |
|
|
|
$('.toast').fadeOut(5000); |
|
|
|
|
|
|
|
|
|
|
|
if (annotations_attributes.length > 0) { |
|
|
|
if (annotations_attributes.length > 0) { |
|
|
|
@ -98,7 +98,7 @@ export default class extends ApplicationController { |
|
|
|
$.post("/api/doctrines/" + doctrine.id + "/annotations", annotation, function(result, status) { |
|
|
|
$.post("/api/doctrines/" + doctrine.id + "/annotations", annotation, function(result, status) { |
|
|
|
if(status === 'success') { |
|
|
|
if(status === 'success') { |
|
|
|
$('.toast').addClass('bg-success').show(); |
|
|
|
$('.toast').addClass('bg-success').show(); |
|
|
|
$( ".toast-body" ).html( "<span><b>Case Lists was successfully save</b></span>" ); |
|
|
|
$( ".toast-body" ).html( "<span><b>Case Lists was successfully saved</b></span>" ); |
|
|
|
$('.toast').fadeOut(5000); |
|
|
|
$('.toast').fadeOut(5000); |
|
|
|
|
|
|
|
|
|
|
|
if (index === annotations_attributes.length - 1) { |
|
|
|
if (index === annotations_attributes.length - 1) { |
|
|
|
@ -196,7 +196,6 @@ export default class extends ApplicationController { |
|
|
|
content: $modal.find("input[name='document_title']").val(), phil_rep: $modal.find("#phil_rep").val(), |
|
|
|
content: $modal.find("input[name='document_title']").val(), phil_rep: $modal.find("#phil_rep").val(), |
|
|
|
editor_notes: $modal.find("input[name='editor_notes']").val(), annomark_ids: $modal.find("select[name='annomark_ids[]']").val() } |
|
|
|
editor_notes: $modal.find("input[name='editor_notes']").val(), annomark_ids: $modal.find("select[name='annomark_ids[]']").val() } |
|
|
|
|
|
|
|
|
|
|
|
console.log(annotaitons_attributes_index.length) |
|
|
|
|
|
|
|
if (annotaitons_attributes_index.length > 0) { |
|
|
|
if (annotaitons_attributes_index.length > 0) { |
|
|
|
annotations_attributes.splice(annotaitons_attributes_index, 1, params) |
|
|
|
annotations_attributes.splice(annotaitons_attributes_index, 1, params) |
|
|
|
$( ".toast-body" ).html( "<span><b>Case List is successfully updated.</b></span>" ); |
|
|
|
$( ".toast-body" ).html( "<span><b>Case List is successfully updated.</b></span>" ); |
|
|
|
|