Vanessa пре 2 година
родитељ
комит
57d0ae7be8
4 измењених фајлова са 15 додато и 15 уклоњено
  1. 1 1
      app/src/editor/util.ts
  2. 9 9
      app/src/layout/util.ts
  3. 2 2
      app/src/plugin/index.ts
  4. 3 3
      app/src/protyle/ui/initUI.ts

+ 1 - 1
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) {

+ 9 - 9
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) => {

+ 2 - 2
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];

+ 3 - 3
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;
             }