Vanessa 2024-04-02 17:32:20 +08:00
parent e7fd94046d
commit c6d69fd6f8
2 changed files with 2 additions and 0 deletions

View file

@ -6,6 +6,7 @@ import {writeText} from "../../protyle/util/compatibility";
import {showMessage} from "../../dialog/message";
export const globalClick = (event: MouseEvent & { target: HTMLElement }) => {
document.getElementById("dragGhost")?.remove();
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) &&
window.siyuan.menus.menu.element.contains(document.activeElement)) {

View file

@ -236,6 +236,7 @@ export class Outline extends Model {
item.style.opacity = "0.38";
const ghostElement = item.cloneNode(true) as HTMLElement;
document.body.append(ghostElement);
ghostElement.dataset.id = "dragGhost"
ghostElement.firstElementChild.setAttribute("style", "padding-left:4px");
ghostElement.setAttribute("style", `border-radius: var(--b3-border-radius);background-color: var(--b3-list-hover);position: fixed; top: ${event.clientY}px; left: ${event.clientX}px; z-index:999997;`);