mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-25 08:24:06 +01:00
This commit is contained in:
parent
c93dc582a5
commit
46e7b0d82b
3 changed files with 4 additions and 17 deletions
|
|
@ -818,11 +818,11 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
event.preventDefault();
|
||||
} else if (target.classList.contains("protyle-action")) {
|
||||
const ghostElement = document.createElement("div");
|
||||
ghostElement.className = protyle.wysiwyg.element.className + " dragghost";
|
||||
ghostElement.className = protyle.wysiwyg.element.className;
|
||||
ghostElement.append(processClonePHElement(target.parentElement.cloneNode(true) as Element));
|
||||
ghostElement.setAttribute("style", `position:fixed;opacity:.1;width:${target.parentElement.clientWidth}px;padding:0;`);
|
||||
document.body.append(ghostElement);
|
||||
event.dataTransfer.setDragImage(ghostElement, target.clientWidth / 2, target.clientHeight / 2);
|
||||
event.dataTransfer.setDragImage(ghostElement, 0, 0);
|
||||
setTimeout(() => {
|
||||
ghostElement.remove();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue