diff options
author | 2024-02-10 18:37:40 -0700 | |
---|---|---|
committer | 2024-02-13 06:59:44 +0530 | |
commit | e1c47572a6235fd8fd20af888ac3a11c7ae1369d (patch) | |
tree | 2dccff36a441916d7014037cef3f7ce84a790cad /public/js/new.js | |
parent | refactor: project maintenance (diff) | |
download | ferdium-server-e1c47572a6235fd8fd20af888ac3a11c7ae1369d.tar.gz ferdium-server-e1c47572a6235fd8fd20af888ac3a11c7ae1369d.tar.zst ferdium-server-e1c47572a6235fd8fd20af888ac3a11c7ae1369d.zip |
updates
Diffstat (limited to 'public/js/new.js')
-rw-r--r-- | public/js/new.js | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/public/js/new.js b/public/js/new.js index 593258e..62c2e4b 100644 --- a/public/js/new.js +++ b/public/js/new.js | |||
@@ -1,24 +1,24 @@ | |||
1 | /* eslint-env browser */ | 1 | /* eslint-env browser */ |
2 | const elDrop = document.querySelector('#dropzone') | 2 | const elDrop = document.querySelector('#dropzone'); |
3 | const submitBtn = document.querySelector('#submitbutton') | 3 | const submitBtn = document.querySelector('#submitbutton'); |
4 | const fileInput = document.querySelector('#files') | 4 | const fileInput = document.querySelector('#files'); |
5 | 5 | ||
6 | elDrop.addEventListener('dragover', (event) => { | 6 | elDrop.addEventListener('dragover', event => { |
7 | event.preventDefault() | 7 | event.preventDefault(); |
8 | }) | 8 | }); |
9 | 9 | ||
10 | elDrop.addEventListener('drop', async (event) => { | 10 | elDrop.addEventListener('drop', async event => { |
11 | event.preventDefault() | 11 | event.preventDefault(); |
12 | 12 | ||
13 | submitBtn.disabled = true | 13 | submitBtn.disabled = true; |
14 | 14 | ||
15 | fileInput.files = event.dataTransfer.files | 15 | fileInput.files = event.dataTransfer.files; |
16 | 16 | ||
17 | elDrop.textContent = `✓ ${fileInput.files.length} files selected` | 17 | elDrop.textContent = `✓ ${fileInput.files.length} files selected`; |
18 | elDrop.style.height = 'inherit' | 18 | elDrop.style.height = 'inherit'; |
19 | 19 | ||
20 | submitBtn.disabled = false | 20 | submitBtn.disabled = false; |
21 | }) | 21 | }); |
22 | elDrop.addEventListener('click', () => { | 22 | elDrop.addEventListener('click', () => { |
23 | fileInput.click() | 23 | fileInput.click(); |
24 | }) | 24 | }); |