Skip to content

Commit

Permalink
add progress percentage to file uploader
Browse files Browse the repository at this point in the history
  • Loading branch information
Vyladence committed Mar 29, 2024
1 parent bacc940 commit 9300d70
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions public/scripts/admin_file_uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,11 @@ function copyText (text) {
percentage = Math.floor(percentDecimal * 100)

document.getElementById("upload_progress").style.width = (percentDecimal * 600) + "px"
document.getElementById("stylized_upload_button").children[0].innerHTML = percentage + "%"


if (percentage == 100) {
document.getElementById("stylized_upload_button").children[0].style.fontWeight = "700"
document.getElementById("stylized_upload_button").children[0].style.transition = "0ms"
document.getElementById("stylized_upload_button").children[0].style.color = "black"
document.getElementById("stylized_upload_button").children[0].innerHTML = "Processing..."
document.getElementById("stylized_upload_button").children[0].style.transform = ""
}
};

Expand All @@ -101,7 +99,6 @@ function copyText (text) {
xhr.setRequestHeader("Accept", "application/json")

document.getElementById("stylized_upload_button").style.width = "100%"
document.getElementById("stylized_upload_button").children[0].style.transform = "translateX(350px)"

// Send the data.
xhr.send(formData);
Expand Down

0 comments on commit 9300d70

Please sign in to comment.