Vanessa 2024-01-23 13:08:49 +08:00
parent 16e1bf90ac
commit 2cec76fcc5
5 changed files with 80 additions and 45 deletions

View file

@ -158,15 +158,21 @@ export const bindCardEvent = async (options: {
window.siyuan.mobile.popEditor = editor;
}
if (options.cardsData.cards.length > 0) {
fetchPost("/api/filetree/getDoc", {
fetchPost("/api/block/getDocInfo", {
id: options.cardsData.cards[index].blockID,
mode: 0,
size: Constants.SIZE_GET_MAX
}, (response) => {
onGet({
data: response,
protyle: editor.protyle,
action: response.data.rootID === response.data.id ? [Constants.CB_GET_HTML] : [Constants.CB_GET_ALL, Constants.CB_GET_HTML],
editor.protyle.wysiwyg.renderCustom(response.data.ial);
fetchPost("/api/filetree/getDoc", {
id: options.cardsData.cards[index].blockID,
mode: 0,
size: Constants.SIZE_GET_MAX
}, (response) => {
onGet({
updateReadonly: true,
data: response,
protyle: editor.protyle,
action: response.data.rootID === response.data.id ? [Constants.CB_GET_HTML] : [Constants.CB_GET_ALL, Constants.CB_GET_HTML],
});
});
});
}
@ -531,15 +537,21 @@ const nextCard = (options: {
} else {
options.actionElements[0].firstElementChild.removeAttribute("disabled");
}
fetchPost("/api/filetree/getDoc", {
fetchPost("/api/block/getDocInfo", {
id: options.blocks[options.index].blockID,
mode: 0,
size: Constants.SIZE_GET_MAX
}, (response) => {
onGet({
data: response,
protyle: options.editor.protyle,
action: response.data.rootID === response.data.id ? [Constants.CB_GET_HTML] : [Constants.CB_GET_ALL, Constants.CB_GET_HTML],
options.editor.protyle.wysiwyg.renderCustom(response.data.ial);
fetchPost("/api/filetree/getDoc", {
id: options.blocks[options.index].blockID,
mode: 0,
size: Constants.SIZE_GET_MAX
}, (response) => {
onGet({
updateReadonly: true,
data: response,
protyle: options.editor.protyle,
action: response.data.rootID === response.data.id ? [Constants.CB_GET_HTML] : [Constants.CB_GET_ALL, Constants.CB_GET_HTML],
});
});
});
};

View file

@ -288,15 +288,21 @@ const getArticle = (edit: Protyle, id: string) => {
edit.protyle.element.nextElementSibling.classList.add("fn__none");
edit.protyle.scroll.lastScrollTop = 0;
addLoading(edit.protyle);
fetchPost("/api/filetree/getDoc", {
fetchPost("/api/block/getDocInfo", {
id,
mode: 0,
size: Constants.SIZE_GET_MAX,
}, getResponse => {
onGet({
data: getResponse,
protyle: edit.protyle,
action: getResponse.data.rootID === getResponse.data.id ? [Constants.CB_GET_HTML] : [Constants.CB_GET_ALL, Constants.CB_GET_HTML],
}, (response) => {
edit.protyle.wysiwyg.renderCustom(response.data.ial);
fetchPost("/api/filetree/getDoc", {
id,
mode: 0,
size: Constants.SIZE_GET_MAX,
}, getResponse => {
onGet({
updateReadonly: true,
data: getResponse,
protyle: edit.protyle,
action: getResponse.data.rootID === getResponse.data.id ? [Constants.CB_GET_HTML] : [Constants.CB_GET_ALL, Constants.CB_GET_HTML],
});
});
});
};