mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-19 13:38:06 +01:00
🚨
This commit is contained in:
parent
436f439dd1
commit
c8ab7693f1
11 changed files with 58 additions and 60 deletions
|
|
@ -157,7 +157,7 @@ export class Backlink extends Model {
|
|||
this.mTree = new Tree({
|
||||
element: this.element.querySelector(".backlinkMList") as HTMLElement,
|
||||
data: null,
|
||||
click: (element, event) => {
|
||||
click: (element) => {
|
||||
this.toggleItem(element, true);
|
||||
},
|
||||
ctrlClick(element) {
|
||||
|
|
@ -283,7 +283,7 @@ export class Backlink extends Model {
|
|||
|
||||
private toggleItem(liElement: HTMLElement, isMention: boolean) {
|
||||
const svgElement = liElement.firstElementChild.firstElementChild;
|
||||
const docId = liElement.getAttribute("data-node-id")
|
||||
const docId = liElement.getAttribute("data-node-id");
|
||||
if (svgElement.classList.contains("b3-list-item__arrow--open")) {
|
||||
svgElement.classList.remove("b3-list-item__arrow--open");
|
||||
this.editors.find((item, index) => {
|
||||
|
|
@ -302,8 +302,8 @@ export class Backlink extends Model {
|
|||
}, (response) => {
|
||||
const editorElement = document.createElement("div");
|
||||
editorElement.style.minHeight = "auto";
|
||||
editorElement.setAttribute("data-defid", this.blockId)
|
||||
editorElement.setAttribute("data-ismention", isMention? "true" : "false")
|
||||
editorElement.setAttribute("data-defid", this.blockId);
|
||||
editorElement.setAttribute("data-ismention", isMention? "true" : "false");
|
||||
liElement.after(editorElement);
|
||||
const editor = new Protyle(editorElement, {
|
||||
blockId: "",
|
||||
|
|
@ -316,7 +316,7 @@ export class Backlink extends Model {
|
|||
breadcrumb: false,
|
||||
}
|
||||
});
|
||||
editor.protyle.block.rootID = docId
|
||||
editor.protyle.block.rootID = docId;
|
||||
this.editors.push(editor);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -162,15 +162,15 @@ export const countBlockWord = (ids: string[]) => {
|
|||
|
||||
export const renderStatusbarCounter = (stat: { runeCount: number, wordCount: number, linkCount: number, imageCount: number, refCount: number }) => {
|
||||
let html = `<span class="ft__on-surface">${window.siyuan.languages.runeCount}</span> ${stat.runeCount}<span class="fn__space"></span>
|
||||
<span class="ft__on-surface">${window.siyuan.languages.wordCount}</span> ${stat.wordCount}<span class="fn__space"></span>`
|
||||
<span class="ft__on-surface">${window.siyuan.languages.wordCount}</span> ${stat.wordCount}<span class="fn__space"></span>`;
|
||||
if (0 < stat.linkCount) {
|
||||
html += `<span class="ft__on-surface">${window.siyuan.languages.link}</span> ${stat.linkCount}<span class="fn__space"></span>`
|
||||
html += `<span class="ft__on-surface">${window.siyuan.languages.link}</span> ${stat.linkCount}<span class="fn__space"></span>`;
|
||||
}
|
||||
if (0 < stat.imageCount) {
|
||||
html += `<span class="ft__on-surface">${window.siyuan.languages.image}</span> ${stat.imageCount}<span class="fn__space"></span>`
|
||||
html += `<span class="ft__on-surface">${window.siyuan.languages.image}</span> ${stat.imageCount}<span class="fn__space"></span>`;
|
||||
}
|
||||
if (0 < stat.refCount) {
|
||||
html += `<span class="ft__on-surface">${window.siyuan.languages.ref}</span> ${stat.refCount}<span class="fn__space"></span>`
|
||||
html += `<span class="ft__on-surface">${window.siyuan.languages.ref}</span> ${stat.refCount}<span class="fn__space"></span>`;
|
||||
}
|
||||
document.querySelector("#status .status__counter").innerHTML = html;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue