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