launcher: allow dropping files into file fields
This commit is contained in:
parent
f78814ba45
commit
fbfa41bd5a
2 changed files with 18 additions and 2 deletions
|
|
@ -147,6 +147,21 @@ class Settings {
|
|||
})
|
||||
})
|
||||
|
||||
field.addEventListener('drop', (e) => {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
let paths = []
|
||||
for (var f of event.dataTransfer.files) {
|
||||
if (f.path.includes(' ')) {
|
||||
paths.push('"' + f.path + '"')
|
||||
} else {
|
||||
paths.push(f.path)
|
||||
}
|
||||
}
|
||||
input.value = paths.join(' ')
|
||||
DOM.dispatchEvent(input, 'change')
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
reset = field.appendChild(html`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue