diff --git a/app/javascript/controllers/dropzone_controller.js b/app/javascript/controllers/dropzone_controller.js index 3c7667c8..86408d9c 100644 --- a/app/javascript/controllers/dropzone_controller.js +++ b/app/javascript/controllers/dropzone_controller.js @@ -5,6 +5,7 @@ export default class extends Controller { const dropzone = document.getElementById('dropzone'); const fileInput = document.getElementById('content[]'); const fileList = document.getElementById('fileList'); + const fileCount = document.getElementById('fileCount'); dropzone.addEventListener('dragover', (e) => { e.preventDefault(); @@ -38,6 +39,9 @@ export default class extends Controller { listItem.textContent = `${file.name} (${this.formatBytes(file.size)})`; fileList.appendChild(listItem); } + + fileCount.parentElement.classList.remove('hidden'); + fileCount.textContent = `${parseInt(fileCount.textContent) + files.length}`; } formatBytes(bytes) { diff --git a/app/views/fs/message_drafts/_new_form.html.erb b/app/views/fs/message_drafts/_new_form.html.erb index d9ac0cdb..25df931b 100644 --- a/app/views/fs/message_drafts/_new_form.html.erb +++ b/app/views/fs/message_drafts/_new_form.html.erb @@ -16,7 +16,9 @@
alebo ich sem presuňte
- +