This commit is contained in:
Vanessa 2023-09-02 11:13:47 +08:00
parent 8d467c7df2
commit ee62729dc2
31 changed files with 32 additions and 84 deletions

View file

@ -49,7 +49,8 @@ export class BlockPanel {
this.isBacklink = options.isBacklink;
this.element = document.createElement("div");
this.element.classList.add("block__popover", "block__popover--top");
this.element.style.zIndex = (++window.siyuan.zIndex).toString();
this.element.classList.add("block__popover");
const parentElement = hasClosestByClassName(this.targetElement, "block__popover", true);
let level = 1;
@ -95,11 +96,8 @@ export class BlockPanel {
}
});
this.element.addEventListener("click", (event) => {
document.querySelectorAll(".block__popover--top").forEach(item => {
item.classList.remove("block__popover--top");
});
if (this.element && window.siyuan.blockPanels.length > 1) {
this.element.classList.add("block__popover--top");
this.element.style.zIndex = (++window.siyuan.zIndex).toString();
}
let target = event.target as HTMLElement;