diff options
author | Alex Vitkov <alexvitkov98@gmail.com> | 2021-02-12 13:23:58 +0200 |
---|---|---|
committer | Alex Vitkov <alexvitkov98@gmail.com> | 2021-02-12 13:23:58 +0200 |
commit | 5c4c710eb10902da89f872b41b8ffcb0faaab713 (patch) | |
tree | c46d6e4d60fb6b49dfa7edab3c93ddf14573d71e | |
parent | 774fbfdbabf626ccaf768bf421f8b5ed5ce0172b (diff) | |
parent | 7c28081802008f7e451fed7341a8b5aceb573e65 (diff) | |
download | fileup-5c4c710eb10902da89f872b41b8ffcb0faaab713.tar.gz |
Merge branch 'live'
-rw-r--r-- | loggedin.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/loggedin.js b/loggedin.js index 0db4c7c..436719f 100644 --- a/loggedin.js +++ b/loggedin.js @@ -1,3 +1,5 @@ +var FORM_ASYNC = false; + const upload_form = document.getElementById("upload_form"); const the_file = document.getElementById("the_file"); const filename_input = document.getElementById("filename"); @@ -14,6 +16,11 @@ function on_file_added(_e) { if (the_file.files.length >= 1) { filename_input.value = the_file.files[0].name; + if (!FORM_ASYNC) { + upload_form.submit(); + return; + } + // Send the form asynchronously through the fetch api fetch(upload_form.action, { method: upload_form.method, |