🎨 Improve database template empty date rendering https://github.com/siyuan-note/siyuan/issues/10830

This commit is contained in:
Vanessa 2024-04-02 21:15:07 +08:00 committed by Daniel
parent cebeba34ca
commit 299437d751
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 12 additions and 3 deletions

View file

@ -6,7 +6,16 @@ import {writeText} from "../../protyle/util/compatibility";
import {showMessage} from "../../dialog/message";
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 (getSelection().rangeCount > 0 && window.siyuan.menus.menu.element.contains(getSelection().getRangeAt(0).startContainer) &&
window.siyuan.menus.menu.element.contains(document.activeElement)) {