This commit is contained in:
Ross
2021-10-31 21:45:57 +00:00
parent 8a840c7680
commit e9a2072c29
+20 -3
View File
@@ -28,11 +28,28 @@
document.addEventListener('drop', function (e) { e.preventDefault(); }, false);
function getUnusedInputs(inputs) {
new_inputs = [];
for (let i = 0; i < inputs.length; i++) {
input = inputs.get(i);
if (input.value) {
new_inputs.push(input);
}
}
return $(new_inputs);
}
function extendInputs(n) {
// Makes sure we have n inputs available
inputs = $("#rapid-form input[type=file][id^=id_images-]");
// returns available inputs
inputs = getUnusedInputs($("#rapid-form input[type=file][id^=id_images-]"));
//fileInput = document.getElementById("id_images-0-image");
// Make sure we have enough input targets
input_diff = (n - inputs.length)
console.log("diff", input_diff)
@@ -43,7 +60,7 @@
}
// Need to make sure we include the new ones...
inputs = $("#rapid-form input[type=file][id^=id_images-]");
inputs = getUnusedInputs($("#rapid-form input[type=file][id^=id_images-]"));
}
return inputs;
}
@@ -451,7 +468,7 @@
option.appendTo($("#id_examination_to"));
toastr.success(`Examination set to ${option.attr('title')} from dicom data`);
} else {
toastr.warning(`Unable to set examination ${option.attr('title')} from dicom data (it needs creating)`);
toastr.warning(`Unable to set examination ${study_description} from dicom data (it needs creating)`);
}