feat: upload files by dropping (#292)

This commit is contained in:
boojack
2022-10-14 22:59:30 +08:00
committed by GitHub
parent eefd0444c8
commit 086b10717f
5 changed files with 40 additions and 9 deletions

View File

@ -13,6 +13,7 @@ import MemoContent from "./MemoContent";
import MemoResources from "./MemoResources";
import showMemoCardDialog from "./MemoCardDialog";
import showShareMemoImageDialog from "./ShareMemoImageDialog";
import showPreviewImageDialog from "./PreviewImageDialog";
import "../less/memo.less";
dayjs.extend(relativeTime);
@ -159,6 +160,11 @@ const Memo: React.FC<Props> = (props: Props) => {
});
}
}
} else if (targetEl.tagName === "IMG") {
const imgUrl = targetEl.getAttribute("src");
if (imgUrl) {
showPreviewImageDialog(imgUrl);
}
}
};