Skip to content
Snippets Groups Projects
Commit 660d4469 authored by netpro2k's avatar netpro2k
Browse files

Support dropping urls

parent 85c0743d
No related branches found
No related tags found
No related merge requests found
......@@ -318,6 +318,19 @@ const onReady = async () => {
addMedia(imgUrl);
});
document.addEventListener("dragover", e => {
e.preventDefault();
});
document.addEventListener("drop", e => {
e.preventDefault();
const imgUrl = e.dataTransfer.getData("url");
if (imgUrl) {
console.log("Droped: ", imgUrl);
addMedia(imgUrl);
}
});
if (!qsTruthy("offline")) {
document.body.addEventListener("connected", () => {
if (!isBotMode) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment