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