Vanessa 2022-10-02 10:14:54 +08:00
parent 87472d1179
commit 1475fd9747

View file

@ -312,7 +312,7 @@ export class Backlink extends Model {
} }
} }
private toggleItem(liElement: HTMLElement, isMention:boolean) { private toggleItem(liElement: HTMLElement, isMention: boolean) {
const svgElement = liElement.firstElementChild.firstElementChild; const svgElement = liElement.firstElementChild.firstElementChild;
if (svgElement.classList.contains("b3-list-item__arrow--open")) { if (svgElement.classList.contains("b3-list-item__arrow--open")) {
svgElement.classList.remove("b3-list-item__arrow--open"); svgElement.classList.remove("b3-list-item__arrow--open");
@ -322,7 +322,7 @@ export class Backlink extends Model {
if (liElement.nextElementSibling && liElement.nextElementSibling.tagName === "DIV") { if (liElement.nextElementSibling && liElement.nextElementSibling.tagName === "DIV") {
liElement.nextElementSibling.classList.remove("fn__none"); liElement.nextElementSibling.classList.remove("fn__none");
} else { } else {
fetchPost(isMention?"/api/ref/getBackmentionDoc":"/api/ref/getBacklinkDoc", { fetchPost(isMention ? "/api/ref/getBackmentionDoc" : "/api/ref/getBacklinkDoc", {
defID: this.blockId, defID: this.blockId,
refTreeID: liElement.getAttribute("data-node-id") refTreeID: liElement.getAttribute("data-node-id")
}, (response) => { }, (response) => {
@ -331,7 +331,7 @@ export class Backlink extends Model {
liElement.after(editorElement); liElement.after(editorElement);
const editor = new Protyle(editorElement, { const editor = new Protyle(editorElement, {
blockId: "", blockId: "",
backlinkData: response.data.backlinks, backlinkData: isMention ? response.data.backmentions : response.data.backlinks,
render: { render: {
background: false, background: false,
title: false, title: false,