Quellcode durchsuchen

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

Vanessa vor 2 Jahren
Ursprung
Commit
b2c68ba47e
1 geänderte Dateien mit 8 neuen und 2 gelöschten Zeilen
  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 {getAllModels} from "./getAll";
 import {countBlockWord} from "./status";
 import {countBlockWord} from "./status";
 import {saveScroll} from "../protyle/scroll/saveScroll";
 import {saveScroll} from "../protyle/scroll/saveScroll";
+import {Asset} from "../asset";
 
 
 export class Wnd {
 export class Wnd {
     public id: string;
     public id: string;
@@ -324,8 +325,13 @@ export class Wnd {
             return;
             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) {
         if (currentTab && currentTab.model instanceof Editor) {