This commit is contained in:
parent
bd6c423dcf
commit
929b27b7f6
1 changed files with 15 additions and 1 deletions
|
@ -76,6 +76,20 @@ export const onGet = (data: IWebSocketData, protyle: IProtyle, action: string[]
|
|||
protyle.wysiwyg.element.setAttribute("data-doc-type", data.data.type);
|
||||
}
|
||||
|
||||
// 防止动态加载
|
||||
if (action.includes(Constants.CB_GET_APPEND) || action.includes(Constants.CB_GET_BEFORE)) {
|
||||
setHTML({
|
||||
content: html,
|
||||
action,
|
||||
unScroll: false,
|
||||
}, protyle);
|
||||
const loadingElement = protyle.element.querySelector(".fn__loading");
|
||||
if (loadingElement) {
|
||||
loadingElement.remove();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
fetchPost("/api/block/getDocInfo", {
|
||||
id: protyle.block.rootID
|
||||
}, (response) => {
|
||||
|
@ -91,7 +105,7 @@ export const onGet = (data: IWebSocketData, protyle: IProtyle, action: string[]
|
|||
if (!scrollObj) {
|
||||
if (action.includes(Constants.CB_GET_SCROLL) && response.data.ial.scroll) {
|
||||
try {
|
||||
scrollObj = JSON.parse(response.data.ial.scroll)
|
||||
scrollObj = JSON.parse(response.data.ial.scroll.replace(/"/g, '"'));
|
||||
} catch (e) {
|
||||
scrollObj = undefined;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue