This commit is contained in:
Vanessa 2023-03-21 09:25:52 +08:00
parent 9cae635647
commit 4bc21c493b
8 changed files with 12 additions and 13 deletions

View file

@ -959,7 +959,7 @@ export class Toolbar {
const msgId = showMessage(window.siyuan.languages.exporting, 0);
if (renderElement.getAttribute("data-subtype") === "plantuml") {
fetch(renderElement.querySelector("img").getAttribute("src")).then(function (response) {
return response.blob()
return response.blob();
}).then(function (blob) {
const formData = new FormData();
formData.append("file", blob);

View file

@ -460,7 +460,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
if ((event.shiftKey && !event.altKey && !isCtrl(event) && (event.key === "Home" || event.key === "End") && isMac()) ||
(event.shiftKey && !event.altKey && isCtrl(event) && (event.key === "Home" || event.key === "End") && !isMac())) {
const topElement = hasTopClosestByAttribute(nodeElement, "data-node-id", null)
const topElement = hasTopClosestByAttribute(nodeElement, "data-node-id", null);
if (topElement) {
topElement.classList.add("protyle-wysiwyg--select");
let nextElement = event.key === "Home" ? topElement.previousElementSibling : topElement.nextElementSibling;
@ -469,9 +469,9 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
nextElement = event.key === "Home" ? nextElement.previousElementSibling : nextElement.nextElementSibling;
}
if (event.key === "Home") {
protyle.wysiwyg.element.firstElementChild.scrollIntoView()
protyle.wysiwyg.element.firstElementChild.scrollIntoView();
} else {
protyle.wysiwyg.element.lastElementChild.scrollIntoView(false)
protyle.wysiwyg.element.lastElementChild.scrollIntoView(false);
}
}
event.stopPropagation();