From 08dffe67149ea7c2e4f186c3892c717fc9ecee75 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 13 Feb 2023 11:37:56 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/3499 --- app/src/layout/dock/index.ts | 14 +++++++------- app/src/layout/dock/util.ts | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/src/layout/dock/index.ts b/app/src/layout/dock/index.ts index ab002bb0d..f6e4c7fb4 100644 --- a/app/src/layout/dock/index.ts +++ b/app/src/layout/dock/index.ts @@ -92,14 +92,14 @@ export class Dock { this.layout.element.setAttribute("style", `width:${this.layout.element.clientWidth}px; opacity: ${hasActive ? 1 : 0}; ${this.position === "Right" ? "right" : "left"}:${this.element.clientWidth}px; -top: ${document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight}px; -bottom: ${document.getElementById("status").clientHeight + document.getElementById("dockBottom").clientHeight}px;`); +top: ${document.getElementById("toolbar").offsetHeight + document.getElementById("dockTop").offsetHeight}px; +bottom: ${document.getElementById("status").offsetHeight + document.getElementById("dockBottom").offsetHeight}px;`); } else { this.layout.element.setAttribute("style", `height:${this.layout.element.clientHeight}px; opacity: ${hasActive ? 1 : 0}; left:0; right:0; -${this.position === "Top" ? ("top:" + (this.element.clientHeight + document.getElementById("toolbar").clientHeight) + "px") : ("bottom:" + (this.element.clientHeight + document.getElementById("status").clientHeight) + "px")};`); +${this.position === "Top" ? ("top:" + (this.element.offsetHeight + document.getElementById("toolbar").offsetHeight) + "px") : ("bottom:" + (this.element.offsetHeight + document.getElementById("status").offsetHeight) + "px")};`); } target.setAttribute("aria-label", window.siyuan.languages.pin); this.resizeElement.classList.add("fn__none"); @@ -145,8 +145,8 @@ ${this.position === "Top" ? ("top:" + (this.element.clientHeight + document.getE if (this.position === "Left" || this.position === "Right") { this.layout.element.setAttribute("style", `opacity:0px; width:${this.layout.element.clientWidth}px;${this.position === "Right" ? "right" : "left"}:-${this.layout.element.clientWidth}px; -top: ${document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight}px; -bottom: ${document.getElementById("status").clientHeight + document.getElementById("dockBottom").clientHeight}px;`); +top: ${document.getElementById("toolbar").offsetHeight + document.getElementById("dockTop").offsetHeight}px; +bottom: ${document.getElementById("status").offsetHeight + document.getElementById("dockBottom").offsetHeight}px;`); } else { this.layout.element.setAttribute("style", ` opacity:0px; @@ -179,9 +179,9 @@ ${this.position === "Top" ? "top" : "bottom"}:-${this.layout.element.clientHeigh } else if (this.position === "Right") { this.layout.element.style.right = this.element.clientWidth + "px"; } else if (this.position === "Top") { - this.layout.element.style.top = (this.element.clientHeight + document.getElementById("toolbar").clientHeight) + "px"; + this.layout.element.style.top = (this.element.offsetHeight + document.getElementById("toolbar").offsetHeight) + "px"; } else if (this.position === "Bottom") { - this.layout.element.style.bottom = (this.element.clientHeight + document.getElementById("status").clientHeight) + "px"; + this.layout.element.style.bottom = (this.element.offsetHeight + document.getElementById("status").offsetHeight) + "px"; } } diff --git a/app/src/layout/dock/util.ts b/app/src/layout/dock/util.ts index dd7c19b96..127572f26 100644 --- a/app/src/layout/dock/util.ts +++ b/app/src/layout/dock/util.ts @@ -88,23 +88,23 @@ export const openOutline = (protyle: IProtyle) => { export const resetFloatDockSize = () => { if (!window.siyuan.layout.leftDock.pin) { - window.siyuan.layout.leftDock.layout.element.style.top = (document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight) + "px"; - window.siyuan.layout.leftDock.layout.element.style.bottom = (document.getElementById("status").clientHeight + document.getElementById("dockBottom").clientHeight) + "px"; + window.siyuan.layout.leftDock.layout.element.style.top = (document.getElementById("toolbar").offsetHeight + document.getElementById("dockTop").offsetHeight) + "px"; + window.siyuan.layout.leftDock.layout.element.style.bottom = (document.getElementById("status").offsetHeight + document.getElementById("dockBottom").offsetHeight) + "px"; if (window.siyuan.layout.leftDock.layout.element.style.opacity === "1") { window.siyuan.layout.leftDock.layout.element.style.left = window.siyuan.layout.leftDock.element.clientWidth + "px"; } } if (!window.siyuan.layout.rightDock.pin) { - window.siyuan.layout.rightDock.layout.element.style.top = (document.getElementById("toolbar").clientHeight + document.getElementById("dockTop").clientHeight) + "px"; - window.siyuan.layout.rightDock.layout.element.style.bottom = (document.getElementById("status").clientHeight + document.getElementById("dockBottom").clientHeight) + "px"; + window.siyuan.layout.rightDock.layout.element.style.top = (document.getElementById("toolbar").offsetHeight + document.getElementById("dockTop").offsetHeight) + "px"; + window.siyuan.layout.rightDock.layout.element.style.bottom = (document.getElementById("status").offsetHeight + document.getElementById("dockBottom").offsetHeight) + "px"; if (window.siyuan.layout.rightDock.layout.element.style.opacity === "1") { window.siyuan.layout.rightDock.layout.element.style.right = window.siyuan.layout.rightDock.element.clientWidth + "px"; } } if (!window.siyuan.layout.topDock.pin && window.siyuan.layout.topDock.layout.element.style.opacity === "1") { - window.siyuan.layout.topDock.layout.element.style.top = (document.getElementById("dockTop").clientHeight + document.getElementById("toolbar").clientHeight) + "px"; + window.siyuan.layout.topDock.layout.element.style.top = (document.getElementById("dockTop").offsetHeight + document.getElementById("toolbar").offsetHeight) + "px"; } if (!window.siyuan.layout.bottomDock.pin && window.siyuan.layout.bottomDock.layout.element.style.opacity === "1") { - window.siyuan.layout.bottomDock.layout.element.style.bottom = (document.getElementById("dockBottom").clientHeight + document.getElementById("status").clientHeight) + "px"; + window.siyuan.layout.bottomDock.layout.element.style.bottom = (document.getElementById("dockBottom").offsetHeight + document.getElementById("status").offsetHeight) + "px"; } };