浏览代码

:art: pdf

Vanessa 1 年之前
父节点
当前提交
29270b4e88
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      app/src/protyle/export/index.ts

+ 7 - 0
app/src/protyle/export/index.ts

@@ -558,6 +558,13 @@ const renderPDF = async (id: string) => {
         });
         setPadding();
         renderPreview(response.data);
+        window.addEventListener("keydown", (event) => {
+            if (event.key === "Escape") {
+                const {ipcRenderer}  = require("electron");
+                ipcRenderer.send("${Constants.SIYUAN_CMD}", "destroy")
+                event.preventDefault();
+            }
+        })
     });
 </script></body></html>`;
     fetchPost("/api/export/exportTempContent", {content: html}, (response) => {