diff options
author | Frederick Muriuki Muriithi | 2025-01-06 11:19:00 -0600 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2025-01-06 11:22:38 -0600 |
commit | 7c4031b8d82888e32aacea820e701339bf02c724 (patch) | |
tree | c026fc4317ae15bff5805f2efd706512beee0209 /uploader/static | |
parent | dc80c8fbdaa15b8c79a080b405726dae8baf3385 (diff) | |
download | gn-uploader-7c4031b8d82888e32aacea820e701339bf02c724.tar.gz |
Pass in file object rather than file-input element
To make this reusable even in scenarios where a file-input element
does not exist or cannot be updated, pass in the file object itself
rather than a file-input element.
Diffstat (limited to 'uploader/static')
-rw-r--r-- | uploader/static/js/files.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/uploader/static/js/files.js b/uploader/static/js/files.js index 26092f7..9d6bca1 100644 --- a/uploader/static/js/files.js +++ b/uploader/static/js/files.js @@ -1,5 +1,4 @@ -var readFirstNLines = (fileelement, count, process_content_fns) => { - var thefile = fileelement.files[0]; +var readFirstNLines = (thefile, count, process_content_fns) => { var reader = new FileReader(); if(typeof thefile !== "undefined" && thefile !== null) { reader.addEventListener("load", (event) => { |