Vanessa 2022-09-04 22:17:08 +08:00
parent 8143c58cf5
commit 010a3eb002
4 changed files with 17 additions and 1 deletions

View file

@ -456,8 +456,12 @@ export class Wnd {
private renderTabList(event: MouseEvent) {
window.siyuan.menus.menu.remove()
Array.from(this.headersElement.children).forEach((item: HTMLElement) => {
const iconElement = item.querySelector(".item__icon")
const graphicElement = item.querySelector(".item__graphic")
window.siyuan.menus.menu.append(new MenuItem({
label: item.querySelector(".item__text").textContent,
iconHTML: iconElement ? `<span class="b3-menu__icon">${iconElement.innerHTML}</span>` : "",
icon: graphicElement ? graphicElement.firstElementChild.getAttribute("xlink:href").substring(1) : "",
click: () => {
this.switchTab(item, true);
},