This commit is contained in:
parent
4928e8e2fb
commit
44d3db32e6
3 changed files with 34 additions and 4 deletions
|
@ -21,6 +21,18 @@ export const globalClick = (event: MouseEvent & { target: HTMLElement }) => {
|
|||
if (!hasClosestByClassName(event.target, "pdf__outer")) {
|
||||
hideAllElements(["pdfutil"]);
|
||||
}
|
||||
// dock float 时,点击空白处,隐藏 dock。场景:文档树上重命名后
|
||||
if (!isWindow() && window.siyuan.layout.leftDock &&
|
||||
!hasClosestByClassName(event.target, "b3-dialog--open", true) &&
|
||||
!hasClosestByClassName(event.target, "b3-menu") &&
|
||||
!hasClosestByClassName(event.target, "block__popover") &&
|
||||
!hasClosestByClassName(event.target, "dock") &&
|
||||
!hasClosestByClassName(event.target, "layout--float", true)
|
||||
) {
|
||||
window.siyuan.layout.bottomDock.hideDock();
|
||||
window.siyuan.layout.leftDock.hideDock();
|
||||
window.siyuan.layout.rightDock.hideDock();
|
||||
}
|
||||
|
||||
const copyElement = hasTopClosestByClassName(event.target, "protyle-action__copy");
|
||||
if (copyElement) {
|
||||
|
|
|
@ -47,10 +47,7 @@ export const windowMouseMove = (event: MouseEvent & { target: HTMLElement }, mou
|
|||
if (!mouseIsEnter &&
|
||||
event.buttons === 0 && // 鼠标按键被按下时不触发
|
||||
window.siyuan.layout.bottomDock &&
|
||||
!isWindow() &&
|
||||
!hasClosestByClassName(event.target, "b3-dialog", true) &&
|
||||
!hasClosestByClassName(event.target, "block__popover", true) &&
|
||||
!hasClosestByClassName(event.target, "b3-menu")) {
|
||||
!isWindow()) {
|
||||
if (event.clientX < 43) {
|
||||
if (!window.siyuan.layout.leftDock.pin && window.siyuan.layout.leftDock.layout.element.clientWidth > 0 &&
|
||||
// 隐藏停靠栏会导致点击两侧内容触发浮动面板弹出,因此需减小鼠标范围
|
||||
|
|
|
@ -256,6 +256,18 @@ export class Dock {
|
|||
this.layout.element.clientHeight === 0 && this.layout.element.style.height.startsWith("0")) {
|
||||
return;
|
||||
}
|
||||
if ((
|
||||
document.querySelector(".b3-dialog") ||
|
||||
document.querySelector(".block__popover") ||
|
||||
document.querySelector("#commonMenu:not(.fn__none)")
|
||||
) && (
|
||||
window.siyuan.layout.leftDock?.layout.element.style.opacity === "1" ||
|
||||
window.siyuan.layout.rightDock?.layout.element.style.opacity === "1" ||
|
||||
window.siyuan.layout.bottomDock?.layout.element.style.opacity === "1"
|
||||
)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!reset) {
|
||||
this.layout.element.style.opacity = "1";
|
||||
}
|
||||
|
@ -280,6 +292,15 @@ export class Dock {
|
|||
if (document.activeElement && this.layout.element.contains(document.activeElement) && document.activeElement.classList.contains("b3-text-field")) {
|
||||
return;
|
||||
}
|
||||
const dialogElement = document.querySelector(".b3-dialog") as HTMLElement
|
||||
const blockElement = document.querySelector(".block__popover") as HTMLElement
|
||||
const menuElement = document.querySelector("#commonMenu:not(.fn__none)") as HTMLElement
|
||||
if ((dialogElement && dialogElement.style.zIndex > this.layout.element.style.zIndex) || // 文档树上修改 emoji 时
|
||||
(blockElement && blockElement.style.zIndex > this.layout.element.style.zIndex) || // 文档树上弹出悬浮层
|
||||
(menuElement && menuElement.style.zIndex > this.layout.element.style.zIndex) // 面板上弹出菜单时
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (this.position === "Left") {
|
||||
this.layout.element.style.transform = `translateX(-${this.layout.element.clientWidth + 8}px)`;
|
||||
this.layout.element.style.left = "";
|
||||
|
|
Loading…
Add table
Reference in a new issue