made main "add files" area keyboard navible

This commit is contained in:
Danny Coates 2019-02-20 10:59:05 -08:00
parent b1e5073e59
commit fd2b58d96d
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB
1 changed files with 12 additions and 2 deletions

View File

@ -374,14 +374,16 @@ module.exports.empty = function(state, emit) {
>
${state.translate('uploadDropDragMessage')}
</div>
<div class="pb-6 text-center text-base italic">
<div class="text-center text-base italic">
${state.translate('uploadDropClickMessage')}
</div>
<input
id="file-upload"
class="hidden"
class="opacity-0"
type="file"
multiple
onfocus="${focus}"
onblur="${blur}"
onchange="${add}"
onclick="${e => e.stopPropagation()}"
/>
@ -396,6 +398,14 @@ module.exports.empty = function(state, emit) {
</send-upload-area>
`;
function focus(event) {
event.target.nextElementSibling.classList.add('bg-blue-darker');
}
function blur(event) {
event.target.nextElementSibling.classList.remove('bg-blue-darker');
}
function add(event) {
event.preventDefault();
const newFiles = Array.from(event.target.files);