Support drag and drop for file upload
parent
87ed7066d7
commit
4dc268c11f
|
@ -36,6 +36,35 @@
|
||||||
document.querySelector(".file-upload-status").textContent = `no file selected.`
|
document.querySelector(".file-upload-status").textContent = `no file selected.`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
document.addEventListener("dragover", event => {
|
||||||
|
fileInput.style['pointer-events'] = "auto";
|
||||||
|
});
|
||||||
|
|
||||||
|
document.addEventListener("drop", event => {
|
||||||
|
fileInput.style['pointer-events'] = "none";
|
||||||
|
});
|
||||||
|
|
||||||
|
document.addEventListener("dragleave", event => {
|
||||||
|
fileInput.style['pointer-events'] = "none";
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
input[type=file] {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
opacity: 0;
|
||||||
|
border: none;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
gunicorn --threads 16 -b '127.0.0.2:8000' demucs_server:app
|
gunicorn --threads 16 --timeout 5 -b '127.0.0.2:8000' demucs_server:app
|
||||||
|
|
Loading…
Reference in New Issue