mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 15:10:12 +01:00
This commit is contained in:
parent
4aa2b6bdc9
commit
845be76c24
1 changed files with 5 additions and 3 deletions
|
|
@ -89,8 +89,10 @@ export class Menu {
|
|||
|
||||
public addItem(option: IMenu) {
|
||||
const menuItem = new MenuItem(option);
|
||||
this.append(menuItem.element, option.index);
|
||||
return menuItem.element;
|
||||
if (menuItem) {
|
||||
this.append(menuItem.element, option.index);
|
||||
return menuItem.element;
|
||||
}
|
||||
}
|
||||
|
||||
public removeScrollEvent() {
|
||||
|
|
@ -258,7 +260,7 @@ export class MenuItem {
|
|||
submenuElement.classList.add("b3-menu__submenu");
|
||||
submenuElement.innerHTML = '<div class="b3-menu__items"></div>';
|
||||
options.submenu.forEach((item) => {
|
||||
submenuElement.firstElementChild.append(new MenuItem(item).element);
|
||||
submenuElement.firstElementChild.append(new MenuItem(item)?.element || "");
|
||||
});
|
||||
this.element.insertAdjacentHTML("beforeend", '<svg class="b3-menu__icon b3-menu__icon--small"><use xlink:href="#iconRight"></use></svg>');
|
||||
this.element.append(submenuElement);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue