launcher: allow dropping files into file fields

This commit is contained in:
jean-emmanuel 2024-02-21 10:30:52 +01:00
parent f78814ba45
commit fbfa41bd5a
2 changed files with 18 additions and 2 deletions

View file

@ -13,8 +13,9 @@
- xy/multixy: add `axisLock` property; allow locking one the axis by holding `Shift` while dragging if `axisLock` is not set, bypasses it otherwise.
- knob/fader/range: add `colorKnob` property
- misc
- on Mac, start with the launcher window hidden if `Start minimized` is set
- launcher
- on Mac, start hidden if `Start minimized` is set
- allow dropping files into file fields
## 1.25.7

View file

@ -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`