Add data-id attribute to the button of the doc menu #12518 (#12608)

* Add `data-id` attribute to the button of the common MenuItem

* Add `data-id` attribute to the button of the common Menu Item

* Add `data-id` attribute to the button of the common Menu Item

* Add `data-id` attribute to the button of the common Menu Item

* Add `data-id` attribute to the button of the doc tree menu

* rename

* openBy

* sort menu

* riff Card Menu
This commit is contained in:
Jeffrey Chen 2024-09-27 09:18:52 +08:00 committed by GitHub
parent 273b55dbf8
commit 8b0d10bbd4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 122 additions and 20 deletions

View file

@ -40,16 +40,17 @@ export const emitOpenMenu = (options: {
});
if (pluginSubMenu.menus.length > 0) {
if (options.separatorPosition === "top") {
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({id: "separator_pluginTop", type: "separator"}).element);
}
window.siyuan.menus.menu.append(new MenuItem({
id: "plugin",
label: window.siyuan.languages.plugin,
icon: "iconPlugin",
type: "submenu",
submenu: pluginSubMenu.menus,
}).element);
if (options.separatorPosition === "bottom") {
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
window.siyuan.menus.menu.append(new MenuItem({id: "separator_pluginBottom", type: "separator"}).element);
}
}
};