diff options
author | 2021-09-14 19:58:52 +0200 | |
---|---|---|
committer | 2021-09-14 19:58:52 +0200 | |
commit | 95df3522a15631abc51a4295cae0ea401a8d4e1e (patch) | |
tree | e5eb0f368c947683f01458e912f21756fb0d99cb /src/internal-server/public/js | |
parent | docs: add sad270 as a contributor for bug, userTesting [skip ci] (#1941) (diff) | |
download | ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.tar.gz ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.tar.zst ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.zip |
feat: add eslint-plugin-unicorn (#1936)
Diffstat (limited to 'src/internal-server/public/js')
-rw-r--r-- | src/internal-server/public/js/transfer.js | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/internal-server/public/js/transfer.js b/src/internal-server/public/js/transfer.js index 8382bba02..36fdbd61a 100644 --- a/src/internal-server/public/js/transfer.js +++ b/src/internal-server/public/js/transfer.js | |||
@@ -1,13 +1,17 @@ | |||
1 | const submitBtn = document.getElementById('submit'); | 1 | const submitBtn = document.querySelector('#submit'); |
2 | const fileInput = document.getElementById('file'); | 2 | const fileInput = document.querySelector('#file'); |
3 | const fileOutput = document.getElementById('fileoutput'); | 3 | const fileOutput = document.querySelector('#fileoutput'); |
4 | 4 | ||
5 | fileInput.addEventListener('change', () => { | 5 | fileInput?.addEventListener('change', () => { |
6 | const reader = new FileReader(); | 6 | const reader = new FileReader(); |
7 | reader.onload = () => { | 7 | reader.addEventListener('load', () => { |
8 | const text = reader.result; | 8 | const text = reader.result; |
9 | fileOutput.value = text; | 9 | if (fileOutput) { |
10 | submitBtn.disabled = false; | 10 | fileOutput.value = text; |
11 | }; | 11 | } |
12 | if (submitBtn) { | ||
13 | submitBtn.disabled = false; | ||
14 | } | ||
15 | }); | ||
12 | reader.readAsText(fileInput.files[0]); | 16 | reader.readAsText(fileInput.files[0]); |
13 | }); | 17 | }); |