diff --git a/templates/standalone/inputs.julius b/templates/standalone/inputs.julius index 10a32bd18..926dccd1e 100644 --- a/templates/standalone/inputs.julius +++ b/templates/standalone/inputs.julius @@ -24,6 +24,7 @@ }); }; + // allows for multiple file uploads with separate inputs window.utils.reactiveFileUpload = function(input, parent) { var currValidInputCount = 0; var addMore = false; @@ -95,9 +96,6 @@ fileInput.input.addEventListener('blur', function() { fileInput.container.classList.remove('pseudo-focus'); }); - fileInput.label.addEventListener('click', function() { - fileInput.input.click(); - }); fileInput.remover.addEventListener('click', function() { if (fileInput.isValid()) { currValidInputCount--; @@ -109,12 +107,14 @@ // create new wrapped input element with name name function makeInput(name) { var cont = document.createElement('div'); - var desc = document.createElement('span'); + var desc = document.createElement('label'); var nextInput = document.createElement('input'); var remover = document.createElement('div'); cont.classList.add('file-input__container'); desc.classList.add('file-input__label', 'btn'); + desc.setAttribute('for', name + '-' + currValidInputCount); remover.classList.add('file-input__remover'); + nextInput.setAttribute('id', name + '-' + currValidInputCount); nextInput.setAttribute('name', name); nextInput.setAttribute('type', 'file'); cont.appendChild(nextInput);