This commit is contained in:
Ross
2021-10-31 21:07:51 +00:00
parent 21268eec2e
commit a6c4982332
+23 -16
View File
@@ -66,11 +66,33 @@
file = evt.target.files[0];
$(evt.target).removeClass("image-ident-warning");
$(evt.target).removeClass("image-ident-ok");
updateFileList();
//updateFileList();
console.log("input change1", evt);
console.log("input change", evt.target);
ocr(evt.target);
el = evt.target;
console.log(el);
$(el).find(".temp-thumb").remove()
if (el.files.length > 0) {
extra_class = " image-ident-loading";
if ($(el).hasClass("image-ident-warning")) {
extra_class = " image-ident-warning"
} else if ($(el).hasClass("image-ident-ok")) {
extra_class = " image-ident-ok"
}
$(`#drop-filenames span[data-input-id='${el.id}']`).remove()
$("#drop-filenames").append(
`<span data-input-id='${el.id}'><span>${n}: ${el.files[0].name}</span><img class='uploading${extra_class}' data-input-id='${el.id}' src=${URL.createObjectURL(el.files[0])}></span>`
)
}
loadDicomViewerAndFileImages();
// Check if we have selected a examination type
if (!$("#id_examination_to option").length) {
@@ -92,23 +114,8 @@
function updateFileList() {
// Why do we update everything here?
$("#drop-filenames").empty()
$("#image_form_set input[type=file]").each((n, el) => {
console.log(el);
$(el).find(".temp-thumb").remove()
if (el.files.length > 0) {
extra_class = " image-ident-loading";
if ($(el).hasClass("image-ident-warning")) {
extra_class = " image-ident-warning"
} else if ($(el).hasClass("image-ident-ok")) {
extra_class = " image-ident-ok"
}
$("#drop-filenames").append(
`<span>${n}: ${el.files[0].name}</span><img class='uploading${extra_class}' data-input-id='${el.id}' src=${URL.createObjectURL(el.files[0])}>`
)
}
})
loadDicomViewerAndFileImages();
}