Vanessa 2023-02-13 20:17:30 +08:00
parent 592e5f4cd8
commit 34171769d7
3 changed files with 9 additions and 4 deletions

View file

@ -117,6 +117,7 @@ ${this.position === "Top" ? ("top:" + (this.element.offsetHeight + document.getE
} else {
target.setAttribute("aria-label", window.siyuan.languages.unpin);
this.layout.element.style.opacity = "";
this.layout.element.style.transition = "var(--b3-width-transition)";
if (hasActive) {
this.resizeElement.classList.remove("fn__none");
}

View file

@ -198,10 +198,14 @@ export const getSelectionPosition = (nodeElement: Element, range?: Range) => {
if (!parentElement) {
parentElement = range.startContainer.childNodes[range.startOffset - 1] as HTMLElement;
}
while (!parentElement.getClientRects || (parentElement.getClientRects && parentElement.getClientRects().length === 0)) {
parentElement = parentElement.parentElement;
if (!parentElement) {
cursorRect = range.getBoundingClientRect();
} else {
while (!parentElement.getClientRects || (parentElement.getClientRects && parentElement.getClientRects().length === 0)) {
parentElement = parentElement.parentElement;
}
cursorRect = parentElement.getClientRects()[0];
}
cursorRect = parentElement.getClientRects()[0];
}
}
} else {

View file

@ -95,7 +95,7 @@ export const globalShortcut = () => {
});
window.siyuan.hideBreadcrumb = false;
}
if (!isWindow() && !hasClosestByClassName(event.target, "b3-dialog")) {
if (!isWindow() && !hasClosestByClassName(event.target, "b3-dialog") && !hasClosestByClassName(event.target, "b3-menu")) {
if (event.clientX < 43) {
if (!window.siyuan.layout.leftDock.pin && window.siyuan.layout.leftDock.layout.element.clientWidth > 0) {
if (event.clientY > document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight &&