diff --git a/app/src/editor/util.ts b/app/src/editor/util.ts index 7756abbae..fc721bd6e 100644 --- a/app/src/editor/util.ts +++ b/app/src/editor/util.ts @@ -341,7 +341,7 @@ const switchEditor = (editor: Editor, options: IOpenFileOptions, allModels: IMod const newRange = focusBlock(nodeElement); if (newRange) { // 需要更新 range,否则文档大纲点击导致切换页签时因为 resize 中 `保持光标位置不变` 会导致光标跳动 - editor.editor.protyle.toolbar.range = newRange + editor.editor.protyle.toolbar.range = newRange; } scrollCenter(editor.editor.protyle, nodeElement, true); } else if (editor.editor.protyle.block.rootID === options.id) { diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts index 27c636e97..ae652112e 100644 --- a/app/src/layout/util.ts +++ b/app/src/layout/util.ts @@ -240,28 +240,28 @@ export const exportLayout = (options: { }; const pushPluginDock = (app: App, dockItem: IDockTab[], position: TPluginDockPosition) => { - const needPushData: { [key: string]: IPluginDockTab } = {} + const needPushData: { [key: string]: IPluginDockTab } = {}; app.plugins.forEach((pluginItem) => { let isExist = false; dockItem.forEach(existSubItem => { if (Object.keys(pluginItem.docks).includes(existSubItem.type)) { isExist = true; } - }) + }); if (!isExist) { Object.keys(pluginItem.docks).forEach(pluginDockKey => { if (pluginItem.docks[pluginDockKey].config.position === position) { needPushData[pluginDockKey] = pluginItem.docks[pluginDockKey].config; } - }) + }); } - }) + }); dockItem.forEach(existSubItem => { if (existSubItem.hotkeyLangId) { - existSubItem.title = window.siyuan.languages[existSubItem.hotkeyLangId] - existSubItem.hotkey = window.siyuan.config.keymap.general[existSubItem.hotkeyLangId].custom + existSubItem.title = window.siyuan.languages[existSubItem.hotkeyLangId]; + existSubItem.hotkey = window.siyuan.config.keymap.general[existSubItem.hotkeyLangId].custom; } - }) + }); Object.keys(needPushData).forEach(key => { const item = needPushData[key]; dockItem.push({ @@ -272,8 +272,8 @@ const pushPluginDock = (app: App, dockItem: IDockTab[], position: TPluginDockPos hotkey: item.hotkey || "", title: item.title, }); - }) -} + }); +}; const JSONToDock = (json: any, app: App) => { json.left.data.forEach((existItem: IDockTab[], index: number) => { diff --git a/app/src/plugin/index.ts b/app/src/plugin/index.ts index dd4b88e45..eb05a9a62 100644 --- a/app/src/plugin/index.ts +++ b/app/src/plugin/index.ts @@ -159,7 +159,7 @@ export class Plugin { destroy: options.destroy, resize: options.resize, update: options.update, - }) + }); customObj.element.addEventListener("click", (event: MouseEvent) => { setPanelFocus(customObj.element); if (hasClosestByAttribute(event.target as HTMLElement, "data-type", "min")) { @@ -167,7 +167,7 @@ export class Plugin { } }); customObj.element.classList.add("sy__" + type2); - return customObj + return customObj; } }; return this.docks[type2]; diff --git a/app/src/protyle/ui/initUI.ts b/app/src/protyle/ui/initUI.ts index d0768e09a..c7c8481f8 100644 --- a/app/src/protyle/ui/initUI.ts +++ b/app/src/protyle/ui/initUI.ts @@ -73,8 +73,8 @@ export const initUI = (protyle: IProtyle) => { embedBlockElement.firstElementChild.classList.toggle("protyle-icons--show"); } }); - let wheelTimeout: number - const isMacOS = isMac() + let wheelTimeout: number; + const isMacOS = isMac(); protyle.contentElement.addEventListener("mousewheel", (event: WheelEvent) => { if ((isMacOS && !event.metaKey) || (!isMacOS && !event.ctrlKey) || event.deltaX !== 0) { return; @@ -89,7 +89,7 @@ export const initUI = (protyle: IProtyle) => { } } else if (event.deltaY > 0) { if (window.siyuan.config.editor.fontSize > 9) { - window.siyuan.config.editor.fontSize-- + window.siyuan.config.editor.fontSize--; } else { return; }