Skip to content

Commit

Permalink
🎨 #11517
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 authored and 88250 committed May 24, 2024
1 parent 1be46ef commit 9b14fe7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/src/dialog/processSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const reloadSync = (app: App, data: { upsertRootIDs: string[], removeRoot
id: item.editor.protyle.block.rootID,
}, (response) => {
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);
});
} else if (data.removeRootIDs.includes(item.editor.protyle.block.rootID)) {
Expand Down
12 changes: 8 additions & 4 deletions app/src/protyle/scroll/saveScroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ export const getDocByScroll = (options: {
scrollAttr: IScrollAttr,
mergedOptions?: IOptions,
cb?: () => void
focus?: boolean
focus?: boolean,
updateReadonly?: boolean
}) => {
let actions: string[] = [];
if (options.mergedOptions) {
Expand Down Expand Up @@ -80,7 +81,8 @@ export const getDocByScroll = (options: {
protyle: options.protyle,
action: actions,
scrollAttr: options.scrollAttr,
afterCB: options.cb
afterCB: options.cb,
updateReadonly: options.updateReadonly
});
});
} else {
Expand All @@ -90,7 +92,8 @@ export const getDocByScroll = (options: {
protyle: options.protyle,
action: actions,
scrollAttr: options.scrollAttr,
afterCB: options.cb
afterCB: options.cb,
updateReadonly: options.updateReadonly
});
}
});
Expand All @@ -109,7 +112,8 @@ export const getDocByScroll = (options: {
protyle: options.protyle,
action: actions,
scrollAttr: options.scrollAttr,
afterCB: options.cb
afterCB: options.cb,
updateReadonly: options.updateReadonly
});
});
};
5 changes: 3 additions & 2 deletions app/src/protyle/util/reload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {renderBacklink} from "../wysiwyg/renderBacklink";
import {hasClosestByClassName} from "./hasClosest";
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")) {
protyle.preview.render(protyle);
return;
Expand Down Expand Up @@ -51,7 +51,8 @@ export const reloadProtyle = (protyle: IProtyle, focus: boolean) => {
getDocByScroll({
protyle,
focus,
scrollAttr: saveScroll(protyle, true)
scrollAttr: saveScroll(protyle, true),
updateReadonly
});
}
};

0 comments on commit 9b14fe7

Please sign in to comment.