|
@@ -6,7 +6,16 @@ import {writeText} from "../../protyle/util/compatibility";
|
|
import {showMessage} from "../../dialog/message";
|
|
import {showMessage} from "../../dialog/message";
|
|
|
|
|
|
export const globalClick = (event: MouseEvent & { target: HTMLElement }) => {
|
|
export const globalClick = (event: MouseEvent & { target: HTMLElement }) => {
|
|
- document.getElementById("dragGhost")?.remove();
|
|
|
|
|
|
+ const ghostElement = document.getElementById("dragGhost")
|
|
|
|
+ if (ghostElement) {
|
|
|
|
+ const startElement = ghostElement.parentElement.querySelector(`[data-node-id="${ghostElement.getAttribute("data-node-id")}"]`) as HTMLElement
|
|
|
|
+ startElement ? startElement.style.opacity = "" : ""
|
|
|
|
+ ghostElement.parentElement.querySelectorAll(".dragover__top, .dragover__bottom, .dragover").forEach((item: HTMLElement) => {
|
|
|
|
+ item.classList.remove("dragover__top", "dragover__bottom", "dragover");
|
|
|
|
+ item.style.opacity = ""
|
|
|
|
+ });
|
|
|
|
+ ghostElement.remove();
|
|
|
|
+ }
|
|
if (!window.siyuan.menus.menu.element.contains(event.target) && !hasClosestByAttribute(event.target, "data-menu", "true")) {
|
|
if (!window.siyuan.menus.menu.element.contains(event.target) && !hasClosestByAttribute(event.target, "data-menu", "true")) {
|
|
if (getSelection().rangeCount > 0 && window.siyuan.menus.menu.element.contains(getSelection().getRangeAt(0).startContainer) &&
|
|
if (getSelection().rangeCount > 0 && window.siyuan.menus.menu.element.contains(getSelection().getRangeAt(0).startContainer) &&
|
|
window.siyuan.menus.menu.element.contains(document.activeElement)) {
|
|
window.siyuan.menus.menu.element.contains(document.activeElement)) {
|