This commit is contained in:
Vanessa 2022-06-07 19:59:57 +08:00
parent 3007364309
commit 99151601a5

View file

@ -117,7 +117,6 @@ const setHTML = (options: { content: string, action?: string[] }, protyle: IProt
if (protyle.options.render.scroll) {
protyle.scroll.update(protyle.block.blockCount, protyle);
}
if (options.action.includes(Constants.CB_GET_HL)) {
preventScroll(protyle); // 搜索页签滚动会导致再次请求
const hlElement = highlightById(protyle, protyle.block.id, true);
@ -179,6 +178,19 @@ const setHTML = (options: { content: string, action?: string[] }, protyle: IProt
if (protyle.element.classList.contains("block__edit") && (protyle.element.nextElementSibling || protyle.element.previousElementSibling)) {
protyle.element.style.minHeight = Math.min(30 + protyle.wysiwyg.element.clientHeight - 16, window.innerHeight / 3) + "px";
}
// https://github.com/siyuan-note/siyuan/issues/5018
if (!protyle.scroll.element.classList.contains("fn__none") &&
protyle.wysiwyg.element.lastElementChild.getAttribute("data-eof") !== "true" &&
protyle.wysiwyg.element.clientHeight < protyle.contentElement.clientHeight) {
fetchPost("/api/filetree/getDoc", {
id: protyle.wysiwyg.element.lastElementChild.getAttribute("data-node-id"),
mode: 2,
k: protyle.options.key || "",
size: Constants.SIZE_GET,
}, getResponse => {
onGet(getResponse, protyle, [Constants.CB_GET_APPEND, Constants.CB_GET_UNCHANGEID]);
});
}
if (options.action.includes(Constants.CB_GET_APPEND) || options.action.includes(Constants.CB_GET_BEFORE)) {
return;
}