This commit is contained in:
Vanessa 2023-03-14 09:54:12 +08:00
parent c59cfe9332
commit 4ca0c7ed53
3 changed files with 7 additions and 8 deletions

View file

@ -106,7 +106,7 @@ const genUploadedLabel = (responseText: string, protyle: IProtyle) => {
range.collapse(false);
}
// https://github.com/siyuan-note/siyuan/issues/7624
const nodeElement = hasClosestBlock(range.startContainer)
const nodeElement = hasClosestBlock(range.startContainer);
if (nodeElement) {
if (nodeElement.classList.contains("table")) {
insertBlock = false;

View file

@ -1121,24 +1121,24 @@ const renderNextSearchMark = (options: {
edit: Protyle,
target: Element,
}) => {
let matchElement
let matchElement;
const allMatchElements = Array.from(options.edit.protyle.wysiwyg.element.querySelectorAll(`div[data-node-id="${options.id}"] span[data-type~="search-mark"]`));
allMatchElements.find((item, itemIndex) => {
if (item.classList.contains("search-mark--hl")) {
item.classList.remove("search-mark--hl")
matchElement = allMatchElements[itemIndex + 1]
item.classList.remove("search-mark--hl");
matchElement = allMatchElements[itemIndex + 1];
return;
}
})
});
if (!matchElement) {
matchElement = allMatchElements[0]
matchElement = allMatchElements[0];
}
if (matchElement) {
matchElement.classList.add("search-mark--hl");
const contentRect = options.edit.protyle.contentElement.getBoundingClientRect();
options.edit.protyle.contentElement.scrollTop = options.edit.protyle.contentElement.scrollTop + matchElement.getBoundingClientRect().top - contentRect.top - contentRect.height / 2;
}
}
};
const getArticle = (options: {
id: string,
k: string,

View file

@ -9,7 +9,6 @@ import {fetchGet, fetchPost} from "../util/fetch";
import {addBaseURL, setNoteBook} from "../util/pathName";
import {openFileById} from "../editor/util";
import {
downloadProgress,
processSync, progressBackgroundTask,
progressLoading,
progressStatus,