From 4aa3f0eaa468ce32c7e43cec33ea7bac442011da Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sat, 28 Sep 2024 18:08:31 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/11043 --- app/src/layout/dock/Files.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.ts index 8eedf4ca9..c122c40a4 100644 --- a/app/src/layout/dock/Files.ts +++ b/app/src/layout/dock/Files.ts @@ -36,6 +36,9 @@ export class Files extends Model { msgCallback(data) { if (data) { switch (data.cmd) { + case "reloadDocInfo": + this.element.querySelector(`li[data-node-id="${data.data.id}"] .ariaLabel`)?.setAttribute("aria-label", this.genDocAriaLabel(data.data)); + break; case "moveDoc": this.onMove(data); break; @@ -1117,12 +1120,16 @@ export class Files extends Model { setStorageVal(Constants.LOCAL_FILESPATHS, filesPaths); } - private genFileHTML = (item: IFile) => { + private genDocAriaLabel(item: IFile) { + return `${getDisplayName(item.name, true, true)} ${item.hSize}${item.bookmark ? "
" + window.siyuan.languages.bookmark + " " + item.bookmark : ""}${item.name1 ? "
" + window.siyuan.languages.name + " " + item.name1 : ""}${item.alias ? "
" + window.siyuan.languages.alias + " " + item.alias : ""}${item.memo ? "
" + window.siyuan.languages.memo + " " + item.memo : ""}${item.subFileCount !== 0 ? window.siyuan.languages.includeSubFile.replace("x", item.subFileCount) : ""}
${window.siyuan.languages.modifiedAt} ${item.hMtime}
${window.siyuan.languages.createdAt} ${item.hCtime}`; + } + + private genFileHTML(item: IFile) { let countHTML = ""; if (item.count && item.count > 0) { countHTML = `${item.count}`; } - const ariaLabel = `${getDisplayName(item.name, true, true)} ${item.hSize}${item.bookmark ? "
" + window.siyuan.languages.bookmark + " " + item.bookmark : ""}${item.name1 ? "
" + window.siyuan.languages.name + " " + item.name1 : ""}${item.alias ? "
" + window.siyuan.languages.alias + " " + item.alias : ""}${item.memo ? "
" + window.siyuan.languages.memo + " " + item.memo : ""}${item.subFileCount !== 0 ? window.siyuan.languages.includeSubFile.replace("x", item.subFileCount) : ""}
${window.siyuan.languages.modifiedAt} ${item.hMtime}
${window.siyuan.languages.createdAt} ${item.hCtime}`; + const ariaLabel = this.genDocAriaLabel(item) return `