This commit is contained in:
Ross
2021-11-12 13:54:53 +00:00
parent 000265b9ea
commit bd0b1787f7
+7 -10
View File
@@ -10,7 +10,8 @@
let monitor_interval_id = false;
// set to hold the files that are still being processed
let active_file_inputs = new Set()
let active_file_inputs = new Set();
let drops_processing = False;
async function listAllFilesAndDirs(dirHandle, files_only) {
const files = [];
@@ -230,6 +231,7 @@
// Loop through each dropped file and try to assign to an
// input element
drops_processing = true;
[...evt.dataTransfer.files].forEach((f) => {
feedback = false;
if (evt.target.id == "feedback-drop-target") {
@@ -237,12 +239,7 @@
}
addFile(f, feedback)
})
// // If you want to use some of the dropped files
// const dT = new DataTransfer();
// dT.items.add(evt.dataTransfer.files[0]);
// dT.items.add(evt.dataTransfer.files[3]);
// fileInput.files = dT.files;
drops_processing = false;
evt.preventDefault();
evt.stopPropagation();
@@ -492,7 +489,7 @@ setTimeout(function (){
active_file_inputs.delete(el)
console.log("active", active_file_inputs)
// Only load once all queued files have been processed
if (active_file_inputs.size < 1) {
if (active_file_inputs.size < 1 && !drops_processing) {
loadViewer();
}
}
@@ -666,11 +663,11 @@ answers that match those added below will be used for automatic marking. Multipl
If
the feedback image box is checked they will not be displayed when taking the question.
</p>
<div>
<!-- <div>
To monitor a directory select it here.<br />
<button id="directory-picker-button">Pick a directory</button>
<span id="directory-picker-display">No directory monitored</span>
</div>
</div> -->
<form action="" method="post" enctype="multipart/form-data" id="rapid-form">
{% csrf_token %}
<a href="/rapids/abnormality/create" id="add_abnormality" class="add-popup"