mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
ba8ff1cb31
commit
27670e3a16
1 changed files with 13 additions and 5 deletions
|
|
@ -157,11 +157,11 @@ export const exportLayout = (reload: boolean, cb?: () => void) => {
|
|||
};
|
||||
layoutToJSON(window.siyuan.layout.layout, layoutJSON.layout);
|
||||
fetchPost("/api/system/setUILayout", {layout: layoutJSON, exit: typeof cb !== "undefined"}, () => {
|
||||
if (reload) {
|
||||
window.location.reload();
|
||||
} else if (cb) {
|
||||
cb();
|
||||
}
|
||||
if (reload) {
|
||||
window.location.reload();
|
||||
} else if (cb) {
|
||||
cb();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -455,6 +455,14 @@ export const resizeTabs = () => {
|
|||
}
|
||||
});
|
||||
}
|
||||
// 保持光标位置不变 https://ld246.com/article/1673704873983/comment/1673765814595#comments
|
||||
if (!item.element.classList.contains("fn__none") && item.editor.protyle.toolbar.range) {
|
||||
const wysiwygRect = item.editor.protyle.wysiwyg.element.getBoundingClientRect()
|
||||
const rangeRect = item.editor.protyle.toolbar.range.getBoundingClientRect()
|
||||
if (wysiwygRect.top > rangeRect.top || wysiwygRect.bottom < rangeRect.bottom) {
|
||||
item.editor.protyle.toolbar.range.startContainer.parentElement.scrollIntoView(wysiwygRect.top > rangeRect.top);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
// https://github.com/siyuan-note/siyuan/issues/6250
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue