mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
This commit is contained in:
parent
708da7c753
commit
74b5badbbc
2 changed files with 6 additions and 4 deletions
|
@ -387,7 +387,7 @@ const switchEditor = (editor: Editor, options: IOpenFileOptions, allModels: IMod
|
|||
highlightById(editor.editor.protyle, options.id, true);
|
||||
} else if (options.action?.includes(Constants.CB_GET_FOCUS)) {
|
||||
if (nodeElement) {
|
||||
const newRange = focusBlock(nodeElement);
|
||||
const newRange = focusBlock(nodeElement, undefined, options.action?.includes(Constants.CB_GET_SETID) ? false : true);
|
||||
if (newRange) {
|
||||
editor.editor.protyle.toolbar.range = newRange;
|
||||
}
|
||||
|
|
|
@ -78,8 +78,10 @@ export const onGet = (options: {
|
|||
options.protyle.wysiwyg.element.setAttribute("data-doc-type", options.data.data.type);
|
||||
}
|
||||
|
||||
// 防止动态加载加载过多的内容
|
||||
if (options.action.includes(Constants.CB_GET_APPEND) || options.action.includes(Constants.CB_GET_BEFORE) || options.action.includes(Constants.CB_GET_HTML)) {
|
||||
if (options.protyle.options.render.title && options.protyle.title.element.getAttribute("data-render") !== "true") {
|
||||
// 文档A的大纲,关闭文档A后,点击大纲无法渲染头部
|
||||
} else if (options.action.includes(Constants.CB_GET_APPEND) || options.action.includes(Constants.CB_GET_BEFORE) || options.action.includes(Constants.CB_GET_HTML)) {
|
||||
// 防止动态加载加载过多的内容
|
||||
setHTML({
|
||||
content: options.data.data.content,
|
||||
expand: options.data.data.isBacklinkExpand,
|
||||
|
@ -448,7 +450,7 @@ const focusElementById = (protyle: IProtyle, action: string[], scrollAttr?: IScr
|
|||
if (scrollAttr && scrollAttr.focusId) {
|
||||
range = focusByOffset(focusElement, scrollAttr.focusStart, scrollAttr.focusEnd) as Range;
|
||||
} else {
|
||||
focusBlock(focusElement);
|
||||
focusBlock(focusElement, undefined, action.includes(Constants.CB_GET_SETID) ? false : true);
|
||||
}
|
||||
/// #if !MOBILE
|
||||
if (!action.includes(Constants.CB_GET_UNUNDO)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue