浏览代码

:bug: fix https://github.com/siyuan-note/siyuan/issues/5646

Vanessa 2 年之前
父节点
当前提交
b2c68ba47e
共有 1 个文件被更改,包括 8 次插入2 次删除
  1. 8 2
      app/src/layout/Wnd.ts

+ 8 - 2
app/src/layout/Wnd.ts

@@ -25,6 +25,7 @@ import {scrollCenter} from "../util/highlightById";
 import {getAllModels} from "./getAll";
 import {countBlockWord} from "./status";
 import {saveScroll} from "../protyle/scroll/saveScroll";
+import {Asset} from "../asset";
 
 export class Wnd {
     public id: string;
@@ -324,8 +325,13 @@ export class Wnd {
             return;
         }
 
-        if (currentTab && target === currentTab.headElement && currentTab.model instanceof Graph) {
-            currentTab.model.onGraph(false);
+        if (currentTab && target === currentTab.headElement) {
+            if (currentTab.model instanceof Graph) {
+                currentTab.model.onGraph(false);
+            } else if (currentTab.model instanceof Asset && currentTab.model.pdfObject) {
+                // https://ld246.com/article/1660283484105
+                currentTab.model.pdfObject.pdfViewer.container.focus();
+            }
         }
 
         if (currentTab && currentTab.model instanceof Editor) {