fixes #1013. dragging page elements
This commit is contained in:
parent
c99697caae
commit
74d8a12c07
2 changed files with 9 additions and 1 deletions
|
@ -98,6 +98,9 @@ export default function(state, emitter) {
|
|||
});
|
||||
|
||||
emitter.on('addFiles', async ({ files }) => {
|
||||
if (files.length < 1) {
|
||||
return;
|
||||
}
|
||||
const maxSize = state.user.maxSize;
|
||||
state.archive = state.archive || new Archive();
|
||||
try {
|
||||
|
|
|
@ -6,7 +6,12 @@ export default function(state, emitter) {
|
|||
}
|
||||
});
|
||||
document.body.addEventListener('drop', event => {
|
||||
if (state.route === '/' && !state.uploading) {
|
||||
if (
|
||||
state.route === '/' &&
|
||||
!state.uploading &&
|
||||
event.dataTransfer &&
|
||||
event.dataTransfer.files
|
||||
) {
|
||||
event.preventDefault();
|
||||
emitter.emit('addFiles', {
|
||||
files: Array.from(event.dataTransfer.files)
|
||||
|
|
Loading…
Reference in a new issue