This commit is contained in:
Vanessa 2023-04-13 11:33:36 +08:00
parent 7caf6a5699
commit 8075902681
3 changed files with 3 additions and 4 deletions

View file

@ -84,7 +84,7 @@ export class Background {
} else {
this.element.addEventListener("dragover", async (event) => {
event.preventDefault();
})
});
this.element.addEventListener("drop", async (event: DragEvent & { target: HTMLElement }) => {
if (event.dataTransfer.types[0] === "Files" && event.dataTransfer.files[0].type.indexOf("image") !== -1) {
uploadFiles(protyle, [event.dataTransfer.files[0]], undefined, (responseText) => {
@ -98,7 +98,7 @@ export class Background {
});
});
}
})
});
this.imgElement.addEventListener("mousedown", (event: MouseEvent & { target: HTMLElement }) => {
event.preventDefault();
if (!this.element.firstElementChild.querySelector(".protyle-icons").classList.contains("fn__none")) {

View file

@ -16,7 +16,6 @@ import {
import {getCurrentWindow} from "@electron/remote";
/// #endif
import {Constants} from "../../constants";
import {hasClosestByClassName} from "../util/hasClosest";
import {matchHotKey} from "../util/hotKey";
import {readText, updateHotkeyTip, writeText} from "../util/compatibility";
import {escapeHtml} from "../../util/escape";

View file

@ -76,4 +76,4 @@ export const commonClick = (event: MouseEvent & {
event.stopPropagation();
return true;
}
}
};