From 1ec26f3321580fafa87eeca748c0ef020983dcd2 Mon Sep 17 00:00:00 2001 From: Liyuan Li Date: Mon, 24 Aug 2020 21:28:33 +0800 Subject: [PATCH] :rotating_light: --- app/src/graph/index.ts | 6 +++--- app/src/layout/Wnd.ts | 6 +++--- app/src/websocket/onGetConfig.ts | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/graph/index.ts b/app/src/graph/index.ts index b6465c6..5ceb297 100644 --- a/app/src/graph/index.ts +++ b/app/src/graph/index.ts @@ -124,9 +124,9 @@ export class Graph extends Model { !item.element.classList.contains("fn__none")) { const vditorElement = item.vditore.vditor.ir.element; vditorElement.querySelectorAll(".editor__blockref").forEach(item=> { - item.classList.remove("editor__blockref") - }) - const nodeElement = vditorElement.querySelector(`[data-node-id="${params.name}"]`) as HTMLElement + item.classList.remove("editor__blockref"); + }); + const nodeElement = vditorElement.querySelector(`[data-node-id="${params.name}"]`) as HTMLElement; if (nodeElement && nodeElement.getClientRects().length > 0) { nodeElement.classList.add("editor__blockref"); vditorElement.scrollTop = nodeElement.offsetTop - vditorElement.clientHeight / 2; diff --git a/app/src/layout/Wnd.ts b/app/src/layout/Wnd.ts index de7d595..6288452 100644 --- a/app/src/layout/Wnd.ts +++ b/app/src/layout/Wnd.ts @@ -324,9 +324,9 @@ export class Wnd { window.liandi.centerLayout.element.style.width = (window.liandi.centerLayout.element.clientWidth - 200) + "px"; layout.element.style.width = "206px"; } else if (layout.type === "right" && layout.element.clientWidth < 7) { - const rightWidth = window.innerWidth / 3 + const rightWidth = window.innerWidth / 3; window.liandi.centerLayout.element.style.width = (window.liandi.centerLayout.element.clientWidth - rightWidth) + "px"; - window.liandi.rightLayoutWidth = rightWidth + window.liandi.rightLayoutWidth = rightWidth; } else if (layout.type === "top" && layout.element.clientHeight < 7) { window.liandi.centerLayout.parent.element.style.height = (window.liandi.centerLayout.parent.element.clientHeight - 200) + "px"; layout.element.style.height = "206px"; @@ -334,7 +334,7 @@ export class Wnd { (layout.element.clientHeight + window.liandi.centerLayout.parent.element.clientHeight + window.liandi.topLayout.element.clientHeight > window.innerHeight || layout.element.clientHeight < 7)) { window.liandi.centerLayout.parent.element.style.height = (window.liandi.centerLayout.parent.element.clientHeight - 200) + "px"; - window.liandi.bottomLayoutHeight = 200 + window.liandi.bottomLayoutHeight = 200; } } else if (layout.children[0].children.length === 1) { if (layout.type === "left" || layout.type === "right") { diff --git a/app/src/websocket/onGetConfig.ts b/app/src/websocket/onGetConfig.ts index 511f344..31b334a 100644 --- a/app/src/websocket/onGetConfig.ts +++ b/app/src/websocket/onGetConfig.ts @@ -54,7 +54,7 @@ const initBar = () => { title: ` ${i18n[window.liandi.config.lang].fileTree}`, callback(tab: Tab) { tab.addModel(new Files(tab)); - (window.liandi.leftLayout.children[0] as Wnd).resetLayout(window.liandi.leftLayout) + (window.liandi.leftLayout.children[0] as Wnd).resetLayout(window.liandi.leftLayout); } }); (window.liandi.leftLayout.children[0] as Wnd).addTab(tab); @@ -66,7 +66,7 @@ const initBar = () => { panel: '
', callback(tab: Tab) { tab.addModel(new Graph({tab})); - (window.liandi.rightLayout.children[0] as Wnd).resetLayout(window.liandi.rightLayout) + (window.liandi.rightLayout.children[0] as Wnd).resetLayout(window.liandi.rightLayout); } }); (window.liandi.rightLayout.children[0] as Wnd).addTab(tab);