Sha256: afadea7d06ac5fe32cf4a8f99d2cb465a00c6fe63ad377970801ec3df4e5ce42
Contents?: true
Size: 822 Bytes
Versions: 30
Compression:
Stored size: 822 Bytes
Contents
<p> <div class="uikit-fileupload"> <input id="{{ include.id }}" type="file" role="button" multiple/> <label class="uikit-btn uikit-btn--tertiary" for="{{ include.id }}"><span>{{ include.label }}</span></label> </div> </p> <script> Array.prototype.forEach.call(document.querySelectorAll('.uikit-fileupload input'), function(input) { var label = input.nextElementSibling; var labelVal = label.innerHTML; input.addEventListener('change', function(e) { var fileName = ''; if(this.files && this.files.length > 1) fileName = (this.files.length + ' files selected'); else fileName = e.target.value.split('\\').pop(); if(fileName) label.querySelector('span').innerHTML = fileName; else label.innerHTML = labelVal; }); }); </script>
Version data entries
30 entries across 30 versions & 1 rubygems