diff --git a/app/src/dialog/processSystem.ts b/app/src/dialog/processSystem.ts index 503f57941..e8c860f0f 100644 --- a/app/src/dialog/processSystem.ts +++ b/app/src/dialog/processSystem.ts @@ -3,6 +3,8 @@ import {fetchPost} from "../util/fetch"; /// #if !MOBILE import {exportLayout} from "../layout/util"; import {getAllModels} from "../layout/getAll"; +import {getDockByType} from "../layout/tabUtil"; +import {Files} from "../layout/dock/Files"; /// #endif import {getAllEditor} from "../layout/getAll"; /// #if !BROWSER @@ -164,8 +166,26 @@ export const setDefRefCount = (data: { "refCount": number, "rootRefCount": number, "rootID": string + refIds: string[] }) => { getAllEditor().forEach(item => { + if (data.rootID === data.blockID && item.protyle.block.rootID === data.rootID) { + const attrElement = item.protyle.title.element.querySelector(".protyle-attr") + const countElement = attrElement.querySelector('.popover__block') + if (countElement) { + if (data.refCount === 0) { + countElement.remove() + } else { + countElement.textContent = data.refCount.toString(); + // TODO + countElement.setAttribute("data-id", data.refIds.toString()) + } + } else if (data.refCount > 0) { + // TODO + attrElement.insertAdjacentHTML("beforeend", `