mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
1be46ef5fd
commit
9b14fe7bdb
3 changed files with 12 additions and 7 deletions
|
|
@ -71,7 +71,7 @@ export const reloadSync = (app: App, data: { upsertRootIDs: string[], removeRoot
|
||||||
id: item.editor.protyle.block.rootID,
|
id: item.editor.protyle.block.rootID,
|
||||||
}, (response) => {
|
}, (response) => {
|
||||||
item.editor.protyle.wysiwyg.renderCustom(response.data.ial);
|
item.editor.protyle.wysiwyg.renderCustom(response.data.ial);
|
||||||
reloadProtyle(item.editor.protyle, false);
|
reloadProtyle(item.editor.protyle, false, true);
|
||||||
updateTitle(item.editor.protyle.block.rootID, item.parent, item.editor.protyle);
|
updateTitle(item.editor.protyle.block.rootID, item.parent, item.editor.protyle);
|
||||||
});
|
});
|
||||||
} else if (data.removeRootIDs.includes(item.editor.protyle.block.rootID)) {
|
} else if (data.removeRootIDs.includes(item.editor.protyle.block.rootID)) {
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,8 @@ export const getDocByScroll = (options: {
|
||||||
scrollAttr: IScrollAttr,
|
scrollAttr: IScrollAttr,
|
||||||
mergedOptions?: IOptions,
|
mergedOptions?: IOptions,
|
||||||
cb?: () => void
|
cb?: () => void
|
||||||
focus?: boolean
|
focus?: boolean,
|
||||||
|
updateReadonly?: boolean
|
||||||
}) => {
|
}) => {
|
||||||
let actions: string[] = [];
|
let actions: string[] = [];
|
||||||
if (options.mergedOptions) {
|
if (options.mergedOptions) {
|
||||||
|
|
@ -80,7 +81,8 @@ export const getDocByScroll = (options: {
|
||||||
protyle: options.protyle,
|
protyle: options.protyle,
|
||||||
action: actions,
|
action: actions,
|
||||||
scrollAttr: options.scrollAttr,
|
scrollAttr: options.scrollAttr,
|
||||||
afterCB: options.cb
|
afterCB: options.cb,
|
||||||
|
updateReadonly: options.updateReadonly
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -90,7 +92,8 @@ export const getDocByScroll = (options: {
|
||||||
protyle: options.protyle,
|
protyle: options.protyle,
|
||||||
action: actions,
|
action: actions,
|
||||||
scrollAttr: options.scrollAttr,
|
scrollAttr: options.scrollAttr,
|
||||||
afterCB: options.cb
|
afterCB: options.cb,
|
||||||
|
updateReadonly: options.updateReadonly
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -109,7 +112,8 @@ export const getDocByScroll = (options: {
|
||||||
protyle: options.protyle,
|
protyle: options.protyle,
|
||||||
action: actions,
|
action: actions,
|
||||||
scrollAttr: options.scrollAttr,
|
scrollAttr: options.scrollAttr,
|
||||||
afterCB: options.cb
|
afterCB: options.cb,
|
||||||
|
updateReadonly: options.updateReadonly
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import {renderBacklink} from "../wysiwyg/renderBacklink";
|
||||||
import {hasClosestByClassName} from "./hasClosest";
|
import {hasClosestByClassName} from "./hasClosest";
|
||||||
import {preventScroll} from "../scroll/preventScroll";
|
import {preventScroll} from "../scroll/preventScroll";
|
||||||
|
|
||||||
export const reloadProtyle = (protyle: IProtyle, focus: boolean) => {
|
export const reloadProtyle = (protyle: IProtyle, focus: boolean, updateReadonly?: boolean) => {
|
||||||
if (!protyle.preview.element.classList.contains("fn__none")) {
|
if (!protyle.preview.element.classList.contains("fn__none")) {
|
||||||
protyle.preview.render(protyle);
|
protyle.preview.render(protyle);
|
||||||
return;
|
return;
|
||||||
|
|
@ -51,7 +51,8 @@ export const reloadProtyle = (protyle: IProtyle, focus: boolean) => {
|
||||||
getDocByScroll({
|
getDocByScroll({
|
||||||
protyle,
|
protyle,
|
||||||
focus,
|
focus,
|
||||||
scrollAttr: saveScroll(protyle, true)
|
scrollAttr: saveScroll(protyle, true),
|
||||||
|
updateReadonly
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue