Browse Source

:rotating_light:

Vanessa 2 years ago
parent
commit
78ed38a33a

+ 1 - 1
app/src/layout/status.ts

@@ -28,7 +28,7 @@ export const initStatus = (isWindow = false) => {
     <div class="b3-menu fn__none" style="bottom: 32px;left: 5px">
         ${menuHTML}
     </div>
-</div>`
+</div>`;
     }
     document.getElementById("status").innerHTML = `${barDockHTML}
 <div class="status__msg"></div>

+ 0 - 1
app/src/layout/util.ts

@@ -28,7 +28,6 @@ import {pdfResize} from "../asset/renderAssets";
 import {Backlink} from "./dock/Backlink";
 import {openFileById} from "../editor/util";
 import {getSearch, isWindow} from "../util/functions";
-import {setTabPosition} from "../window/setHeader";
 
 export const setPanelFocus = (element: Element) => {
     if (element.classList.contains("layout__tab--active") || element.classList.contains("layout__wnd--active")) {

+ 3 - 3
app/src/menus/tab.ts

@@ -223,9 +223,9 @@ export const initTabMenu = (tab: Tab) => {
                     webSecurity: false,
                 },
             });
-            const json = {}
-            layoutToJSON(tab, json)
-            win.loadURL(`${window.location.protocol}//${window.location.host}/stage/build/app/window.html?v=${Constants.SIYUAN_VERSION}&json=${JSON.stringify(json)}`)
+            const json = {};
+            layoutToJSON(tab, json);
+            win.loadURL(`${window.location.protocol}//${window.location.host}/stage/build/app/window.html?v=${Constants.SIYUAN_VERSION}&json=${JSON.stringify(json)}`);
             tab.parent.removeTab(tab.id);
         }
     }).element);

+ 1 - 1
app/src/util/onGetConfig.ts

@@ -518,7 +518,7 @@ export const initWindow = () => {
     </svg>
 </div>`;
     if (isWindow()) {
-        document.body.insertAdjacentHTML("beforeend", `<div class="toolbar__window">${controlsHTML}</div>`)
+        document.body.insertAdjacentHTML("beforeend", `<div class="toolbar__window">${controlsHTML}</div>`);
     } else {
         document.getElementById("windowControls").innerHTML = controlsHTML;
     }

+ 1 - 2
app/src/window/init.ts

@@ -8,7 +8,6 @@ import {appearance} from "../config/appearance";
 import {initAssets, setInlineStyle} from "../util/assets";
 import {renderSnippet} from "../config/util/snippets";
 import {getSearch} from "../util/functions";
-import {Layout} from "../layout";
 import {initWindow} from "../util/onGetConfig";
 
 export const init = () => {
@@ -43,4 +42,4 @@ export const init = () => {
             resizeTabs();
         }, 200);
     });
-}
+};

+ 7 - 7
app/src/window/setHeader.ts

@@ -12,19 +12,19 @@ const getAllWnds = (layout: Layout, wnds: Wnd[]) => {
             getAllWnds(item, wnds);
         }
     }
-}
+};
 export const setTabPosition = () => {
     if (!isWindow()) {
         return;
     }
-    const wndsTemp: Wnd[] = []
+    const wndsTemp: Wnd[] = [];
     getAllWnds(window.siyuan.layout.layout, wndsTemp);
     wndsTemp.forEach(item => {
         const headerElement = item.headersElement.parentElement;
-        const rect = headerElement.getBoundingClientRect()
-        const dragElement = headerElement.querySelector('.item--readonly .fn__flex-1') as HTMLElement
+        const rect = headerElement.getBoundingClientRect();
+        const dragElement = headerElement.querySelector(".item--readonly .fn__flex-1") as HTMLElement;
         if (rect.top <= 0) {
-            dragElement.style.height = dragElement.parentElement.clientHeight + "px"
+            dragElement.style.height = dragElement.parentElement.clientHeight + "px";
             // @ts-ignore
             dragElement.style.WebkitAppRegion = "drag";
         } else {
@@ -44,5 +44,5 @@ export const setTabPosition = () => {
                 (headerElement.lastElementChild as HTMLElement).style.paddingRight = "";
             }
         }
-    })
-}
+    });
+};