diff --git a/app/src/boot/globalEvent/keydown.ts b/app/src/boot/globalEvent/keydown.ts index 9f88b919c..a1458f024 100644 --- a/app/src/boot/globalEvent/keydown.ts +++ b/app/src/boot/globalEvent/keydown.ts @@ -178,7 +178,7 @@ const editKeydown = (app: App, event: KeyboardEvent) => { } }); } - const activeTab = getActiveTab() + const activeTab = getActiveTab(); if (!protyle && activeTab) { if (activeTab.model instanceof Editor) { protyle = activeTab.model.editor.protyle; @@ -1435,7 +1435,7 @@ export const windowKeyDown = (app: App, event: KeyboardEvent) => { if (matchHotKey(window.siyuan.config.keymap.general.closeUnmodified.custom, event) && !event.repeat) { const tab = getActiveTab(false); if (tab) { - const unmodifiedTabs: Tab[] = [] + const unmodifiedTabs: Tab[] = []; tab.parent.children.forEach((item: Tab) => { const editor = item.model as Editor; if (!editor || (editor.editor?.protyle && !editor.editor?.protyle.updated)) { diff --git a/app/src/layout/tabUtil.ts b/app/src/layout/tabUtil.ts index 4c2079f0d..41dee7057 100644 --- a/app/src/layout/tabUtil.ts +++ b/app/src/layout/tabUtil.ts @@ -43,21 +43,21 @@ export const getActiveTab = (wndActive = true) => { export const switchTabByIndex = (index: number) => { const activeDockIcoElement = document.querySelector(".dock .dock__item--activefocus"); if (activeDockIcoElement) { - let indexElement = activeDockIcoElement.parentElement.children[index] + let indexElement = activeDockIcoElement.parentElement.children[index]; if (index === -1) { // 最后一个 - indexElement = activeDockIcoElement.parentElement.lastElementChild + indexElement = activeDockIcoElement.parentElement.lastElementChild; if (!indexElement.getAttribute("data-type")) { - indexElement = indexElement.previousElementSibling + indexElement = indexElement.previousElementSibling; } } else if (index === -2) { // 上一个 - indexElement = activeDockIcoElement.previousElementSibling + indexElement = activeDockIcoElement.previousElementSibling; } else if (index === -3) { // 下一个 - indexElement = activeDockIcoElement.nextElementSibling + indexElement = activeDockIcoElement.nextElementSibling; } - const type = indexElement?.getAttribute("data-type") + const type = indexElement?.getAttribute("data-type"); if (type) { getDockByType(type)?.toggleModel(type, true, false); } @@ -65,23 +65,23 @@ export const switchTabByIndex = (index: number) => { } const tab = getActiveTab(false); if (tab) { - let indexElement = tab.parent.headersElement.children[index] + let indexElement = tab.parent.headersElement.children[index]; if (index === -1) { // 最后一个 - indexElement = tab.parent.headersElement.lastElementChild + indexElement = tab.parent.headersElement.lastElementChild; } else if (index === -2) { // 上一个 - indexElement = tab.headElement.previousElementSibling + indexElement = tab.headElement.previousElementSibling; } else if (index === -3) { // 下一个 - indexElement = tab.headElement.nextElementSibling + indexElement = tab.headElement.nextElementSibling; } if (indexElement) { tab.parent.switchTab(indexElement as HTMLElement, true); tab.parent.showHeading(); } } -} +}; let resizeTimeout: number; export const resizeTabs = () => {