This commit is contained in:
Vanessa 2023-11-30 21:21:43 +08:00
parent 4928e8e2fb
commit 44d3db32e6
3 changed files with 34 additions and 4 deletions

View file

@ -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) {

View file

@ -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 &&
// 隐藏停靠栏会导致点击两侧内容触发浮动面板弹出,因此需减小鼠标范围