diff --git a/rapids/templates/rapids/rapid_form.html b/rapids/templates/rapids/rapid_form.html index 0e7a0604..9e052721 100755 --- a/rapids/templates/rapids/rapid_form.html +++ b/rapids/templates/rapids/rapid_form.html @@ -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( + `${n}: ${el.files[0].name}` + ) + } + + + 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( - `${n}: ${el.files[0].name}` - ) - } }) - loadDicomViewerAndFileImages(); }