From 7b342fc0046647c5f01ff12b178c22871c226343 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 15 Nov 2024 22:29:31 +0800 Subject: [PATCH] :rotating_light: --- app/src/layout/dock/index.ts | 4 ++-- app/src/layout/util.ts | 34 +++++++++++++++--------------- app/src/protyle/wysiwyg/keydown.ts | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/app/src/layout/dock/index.ts b/app/src/layout/dock/index.ts index 88447508a..53f8bfc61 100644 --- a/app/src/layout/dock/index.ts +++ b/app/src/layout/dock/index.ts @@ -817,13 +817,13 @@ export class Dock { activesElement.forEach((item) => { if (this.position === "Left" || this.position === "Right") { if (item.getAttribute("data-index") === "1" && activesElement.length > 1) { - const dockElement = (this.data[item.getAttribute("data-type") as TDock] as Model).parent.parent.element + const dockElement = (this.data[item.getAttribute("data-type") as TDock] as Model).parent.parent.element; item.setAttribute("data-height", dockElement.style.height ? dockElement.clientHeight.toString() : ""); } item.setAttribute("data-width", this.layout.element.clientWidth.toString()); } else { if (item.getAttribute("data-index") === "1" && activesElement.length > 1) { - const dockElement = (this.data[item.getAttribute("data-type") as TDock] as Model).parent.parent.element + const dockElement = (this.data[item.getAttribute("data-type") as TDock] as Model).parent.parent.element; item.setAttribute("data-width", dockElement.style.width ? dockElement.clientWidth.toString() : ""); } item.setAttribute("data-height", this.layout.element.clientHeight.toString()); diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts index aeb01ed03..891595348 100644 --- a/app/src/layout/util.ts +++ b/app/src/layout/util.ts @@ -907,45 +907,45 @@ export const addResize = (obj: Layout | Wnd) => { const previousElement = resizeElement.previousElementSibling as HTMLElement; const nextElement = resizeElement.nextElementSibling as HTMLElement; if (previousElement && nextElement) { - const bigType = ["graph", "inbox", "globalGraph", "backlink"] - let size = 232 + const bigType = ["graph", "inbox", "globalGraph", "backlink"]; + let size = 232; nextElement.style.transition = "none"; previousElement.style.transition = "none"; if (resizeElement.classList.contains("layout__resize--lr")) { if (previousElement.classList.contains("layout__dockl")) { document.querySelectorAll("#dockLeft .dock__item--active").forEach(item => { if (bigType.includes(item.getAttribute("data-type"))) { - size = 320 + size = 320; } - }) - previousElement.style.width = size + 'px' + }); + previousElement.style.width = size + "px"; window.siyuan.layout.leftDock.setSize(); } else if (nextElement.classList.contains("layout__dockr")) { document.querySelectorAll("#dockRight .dock__item--active").forEach(item => { if (bigType.includes(item.getAttribute("data-type"))) { - size = 320 + size = 320; } - }) - nextElement.style.width = size + 'px' + }); + nextElement.style.width = size + "px"; window.siyuan.layout.rightDock.setSize(); } else { - previousElement.style.width = '' - nextElement.style.width = '' - previousElement.classList.add("fn__flex-1") - nextElement.classList.add("fn__flex-1") + previousElement.style.width = ""; + nextElement.style.width = ""; + previousElement.classList.add("fn__flex-1"); + nextElement.classList.add("fn__flex-1"); if (resizeElement.parentElement.classList.contains("layout__dockb")) { window.siyuan.layout.bottomDock.setSize(); } } } else { if (nextElement.classList.contains("layout__dockb")) { - nextElement.style.height = '232px' + nextElement.style.height = "232px"; window.siyuan.layout.bottomDock.setSize(); } else { - previousElement.style.height = '' - nextElement.style.height = '' - previousElement.classList.add("fn__flex-1") - nextElement.classList.add("fn__flex-1") + previousElement.style.height = ""; + nextElement.style.height = ""; + previousElement.classList.add("fn__flex-1"); + nextElement.classList.add("fn__flex-1"); if (resizeElement.parentElement.classList.contains("layout__dockl")) { window.siyuan.layout.leftDock.setSize(); } else if (resizeElement.parentElement.classList.contains("layout__dockr")) { diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts index f953c47d0..55a1070c0 100644 --- a/app/src/protyle/wysiwyg/keydown.ts +++ b/app/src/protyle/wysiwyg/keydown.ts @@ -1180,7 +1180,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { // https://github.com/siyuan-note/siyuan/issues/12989 const cardElement = hasClosestByClassName(range.startContainer, "card__main", true); if (cardElement && document.activeElement && document.activeElement.classList.contains("protyle-wysiwyg")) { - (cardElement.querySelector(".card__action:not(.fn__none) button") as HTMLElement).focus() + (cardElement.querySelector(".card__action:not(.fn__none) button") as HTMLElement).focus(); hideElements(["select"], protyle); } } else {