This commit is contained in:
Vanessa 2022-06-27 22:20:39 +08:00
parent d241569b4c
commit 59bff8376a
3 changed files with 9 additions and 4 deletions

View file

@ -46,7 +46,6 @@ export class Editor extends Model {
},
typewriterMode: true,
after: (editor) => {
editor.protyle.model = this;
if (window.siyuan.config.readonly) {
disabledProtyle(editor.protyle);
}
@ -63,5 +62,6 @@ export class Editor extends Model {
}
},
});
this.editor.protyle.model = this;
}
}

View file

@ -104,8 +104,13 @@ class Protyle {
}
break;
case "rename":
if (this.protyle.path === data.data.path && this.protyle.model) {
this.protyle.model.parent.updateTitle(data.data.title);
if (this.protyle.path === data.data.path) {
if (this.protyle.model) {
this.protyle.model.parent.updateTitle(data.data.title);
}
if (this.protyle.background) {
this.protyle.background.ial.title = data.data.title
}
}
if (this.protyle.options.render.title && this.protyle.block.parentID === data.data.id) {
if (getSelection().rangeCount > 0 && this.protyle.element.contains(getSelection().getRangeAt(0).startContainer)) {

View file

@ -206,7 +206,7 @@ const setHTML = (options: { content: string, action?: string[] }, protyle: IProt
if (!protyle.scroll.element.classList.contains("fn__none") &&
protyle.wysiwyg.element.lastElementChild.getAttribute("data-eof") !== "true" &&
protyle.contentElement.scrollHeight > 0 && // 没有激活的页签 https://github.com/siyuan-note/siyuan/issues/5255
!options.action.includes(Constants.CB_GET_FOCUSFIRST) &&
!options.action.includes(Constants.CB_GET_FOCUSFIRST) && // 防止 eof 为true https://github.com/siyuan-note/siyuan/issues/5291
protyle.contentElement.scrollHeight <= protyle.contentElement.clientHeight) {
fetchPost("/api/filetree/getDoc", {
id: protyle.wysiwyg.element.lastElementChild.getAttribute("data-node-id"),