mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
🚨
This commit is contained in:
parent
c59cfe9332
commit
4ca0c7ed53
3 changed files with 7 additions and 8 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue