mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 16:10:12 +01:00
This commit is contained in:
parent
e5641b1d39
commit
0d1868fe3a
22 changed files with 81 additions and 61 deletions
|
|
@ -28,7 +28,7 @@ export const afterExport = (exportPath: string, msgId: string) => {
|
|||
export const exportImage = (id: string) => {
|
||||
const exportDialog = new Dialog({
|
||||
title: window.siyuan.languages.exportAsImage,
|
||||
content: `<div class="b3-dialog__content" style="max-height: 70vh;overflow: auto;${isMobile() ? "padding:8px;" : ""};background-color: var(--b3-theme-background)">
|
||||
content: `<div class="b3-dialog__content" style="${isMobile() ? "padding:8px;" : ""};background-color: var(--b3-theme-background)">
|
||||
<div style="${isMobile() ? "padding: 16px;margin: 16px 0" : "padding: 48px;margin: 8px 0 24px"};border: 1px solid var(--b3-border-color);border-radius: 10px;" class="export-img protyle-wysiwyg${window.siyuan.config.editor.displayBookmarkIcon ? " protyle-wysiwyg--attr" : ""}" id="preview"></div>
|
||||
<div class="fn__hr--b"></div>
|
||||
<div class="fn__hr--b"></div>
|
||||
|
|
@ -45,6 +45,7 @@ export const exportImage = (id: string) => {
|
|||
</div>
|
||||
<div class="fn__loading"><img height="128px" width="128px" src="stage/loading-pure.svg"></div>`,
|
||||
width: isMobile() ? "92vw" : "990px",
|
||||
height: "70vh"
|
||||
});
|
||||
const btnsElement = exportDialog.element.querySelectorAll(".b3-button");
|
||||
btnsElement[0].addEventListener("click", () => {
|
||||
|
|
@ -52,7 +53,7 @@ export const exportImage = (id: string) => {
|
|||
});
|
||||
btnsElement[1].addEventListener("click", () => {
|
||||
const msgId = showMessage(window.siyuan.languages.exporting, 0);
|
||||
previewElement.parentElement.style.maxHeight = "none";
|
||||
(exportDialog.element.querySelector(".b3-dialog__container") as HTMLElement).style.height = "";
|
||||
setStorageVal(Constants.LOCAL_EXPORTIMG, window.siyuan.storage[Constants.LOCAL_EXPORTIMG]);
|
||||
setTimeout(() => {
|
||||
addScript("stage/protyle/js/html2canvas.min.js?v=1.4.1", "protyleHtml2canvas").then(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue