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); range.collapse(false);
} }
// https://github.com/siyuan-note/siyuan/issues/7624 // https://github.com/siyuan-note/siyuan/issues/7624
const nodeElement = hasClosestBlock(range.startContainer) const nodeElement = hasClosestBlock(range.startContainer);
if (nodeElement) { if (nodeElement) {
if (nodeElement.classList.contains("table")) { if (nodeElement.classList.contains("table")) {
insertBlock = false; insertBlock = false;

View file

@ -1121,24 +1121,24 @@ const renderNextSearchMark = (options: {
edit: Protyle, edit: Protyle,
target: Element, 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"]`)); 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) => { allMatchElements.find((item, itemIndex) => {
if (item.classList.contains("search-mark--hl")) { if (item.classList.contains("search-mark--hl")) {
item.classList.remove("search-mark--hl") item.classList.remove("search-mark--hl");
matchElement = allMatchElements[itemIndex + 1] matchElement = allMatchElements[itemIndex + 1];
return; return;
} }
}) });
if (!matchElement) { if (!matchElement) {
matchElement = allMatchElements[0] matchElement = allMatchElements[0];
} }
if (matchElement) { if (matchElement) {
matchElement.classList.add("search-mark--hl"); matchElement.classList.add("search-mark--hl");
const contentRect = options.edit.protyle.contentElement.getBoundingClientRect(); 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; options.edit.protyle.contentElement.scrollTop = options.edit.protyle.contentElement.scrollTop + matchElement.getBoundingClientRect().top - contentRect.top - contentRect.height / 2;
} }
} };
const getArticle = (options: { const getArticle = (options: {
id: string, id: string,
k: string, k: string,

View file

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