Vanessa 2024-11-22 21:15:18 +08:00
parent 590b088f69
commit d152a7ff6f
3 changed files with 15 additions and 7 deletions

View file

@ -42,7 +42,7 @@ export class Files extends Model {
if (data) {
switch (data.cmd) {
case "reloadDocInfo":
this.element.querySelector(`li[data-node-id="${data.data.rootID}"] .ariaLabel`)?.setAttribute("aria-label", this.genDocAriaLabel(data.data, escapeGreat));
this.updateDocInfo(data);
break;
case "moveDoc":
this.onMove(data);
@ -736,6 +736,14 @@ export class Files extends Model {
}
}
private updateDocInfo(data: IWebSocketData) {
const liElement = this.element.querySelector(`li[data-node-id="${data.data.rootID}"]`)
if (liElement) {
liElement.setAttribute("data-count", data.data.subFileCount);
liElement.querySelector(".ariaLabel")?.setAttribute("aria-label", this.genDocAriaLabel(data.data, escapeGreat));
}
}
private genNotebook(item: INotebook) {
const emojiHTML = `<span class="b3-list-item__icon b3-tooltips b3-tooltips__e" aria-label="${window.siyuan.languages.changeIcon}">${unicode2Emoji(item.icon || window.siyuan.storage[Constants.LOCAL_IMAGES].note)}</span>`;
if (item.closed) {