mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-02 15:21:01 +08:00
This commit is contained in:
parent
217a4e2a0a
commit
55f8c8bb38
@ -12,7 +12,7 @@ import {
|
||||
setFirstNodeRange,
|
||||
setLastNodeRange
|
||||
} from "../util/selection";
|
||||
import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName} from "../util/hasClosest";
|
||||
import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName, hasClosestByTag} from "../util/hasClosest";
|
||||
import {Link} from "./Link";
|
||||
import {setPosition} from "../../util/setPosition";
|
||||
import {updateTransaction} from "../wysiwyg/transaction";
|
||||
@ -946,7 +946,7 @@ export class Toolbar {
|
||||
}
|
||||
}
|
||||
|
||||
public showRender(protyle: IProtyle, renderElement: Element, updateElements?: Element[], oldHTML?: string) {
|
||||
public showRender(protyle: IProtyle, renderElement: HTMLElement, updateElements?: Element[], oldHTML?: string) {
|
||||
const nodeElement = hasClosestBlock(renderElement);
|
||||
if (!nodeElement) {
|
||||
return;
|
||||
@ -1116,8 +1116,9 @@ export class Toolbar {
|
||||
}
|
||||
setTimeout(() => {
|
||||
addScript("/stage/protyle/js/html-to-image.min.js?v=1.11.13", "protyleHtml2image").then(() => {
|
||||
window.htmlToImage.toCanvas(renderElement).then((canvas) => {
|
||||
canvas.toBlob((blob: Blob) => {
|
||||
renderElement.style.display = "inline-block";
|
||||
window.htmlToImage.toBlob(renderElement).then(blob => {
|
||||
renderElement.style.display = "";
|
||||
const formData = new FormData();
|
||||
formData.append("file", blob);
|
||||
formData.append("type", "image/png");
|
||||
@ -1127,7 +1128,6 @@ export class Toolbar {
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}, Constants.TIMEOUT_LOAD);
|
||||
};
|
||||
const textElement = this.subElement.querySelector(".b3-text-field") as HTMLTextAreaElement;
|
||||
|
Loading…
Reference in New Issue
Block a user