mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-19 02:21:38 +08:00
This commit is contained in:
parent
a1c74e4d90
commit
c2c0794e48
@ -385,7 +385,8 @@ export class Backlink extends Model {
|
||||
} else {
|
||||
fetchPost(isMention ? "/api/ref/getBackmentionDoc" : "/api/ref/getBacklinkDoc", {
|
||||
defID: this.blockId,
|
||||
refTreeID: docId
|
||||
refTreeID: docId,
|
||||
keyword: isMention ? this.inputsElement[1].value : this.inputsElement[0].value
|
||||
}, (response) => {
|
||||
svgElement.removeAttribute("disabled");
|
||||
svgElement.classList.add("b3-list-item__arrow--open");
|
||||
|
@ -4,6 +4,7 @@ import {Constants} from "../../constants";
|
||||
import {onGet} from "./onGet";
|
||||
import {saveScroll} from "../scroll/saveScroll";
|
||||
import {renderBacklink} from "../wysiwyg/renderBacklink";
|
||||
import {hasClosestByClassName} from "./hasClosest";
|
||||
|
||||
export const reloadProtyle = (protyle: IProtyle) => {
|
||||
if (window.siyuan.config.editor.displayBookmarkIcon) {
|
||||
@ -17,13 +18,18 @@ export const reloadProtyle = (protyle: IProtyle) => {
|
||||
addLoading(protyle);
|
||||
if (protyle.options.backlinkData) {
|
||||
const isMention = protyle.element.getAttribute("data-ismention") === "true";
|
||||
const tabElement = hasClosestByClassName(protyle.element, "sy__backlink")
|
||||
if (tabElement) {
|
||||
const inputsElement = tabElement.querySelectorAll(".b3-form__icon-input") as NodeListOf<HTMLInputElement>
|
||||
fetchPost(isMention ? "/api/ref/getBackmentionDoc" : "/api/ref/getBacklinkDoc", {
|
||||
defID: protyle.element.getAttribute("data-defid"),
|
||||
refTreeID: protyle.block.rootID
|
||||
refTreeID: protyle.block.rootID,
|
||||
keyword: isMention ? inputsElement[1].value : inputsElement[0].value
|
||||
}, response => {
|
||||
protyle.options.backlinkData = isMention ? response.data.backmentions : response.data.backlinks,
|
||||
renderBacklink(protyle, protyle.options.backlinkData);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
fetchPost("/api/filetree/getDoc", {
|
||||
id: protyle.block.showAll ? protyle.block.id : protyle.block.rootID,
|
||||
|
Loading…
Reference in New Issue
Block a user