This commit is contained in:
Vanessa 2023-10-05 21:13:26 +08:00
parent e1d8a609d0
commit cd3642f0f9
2 changed files with 35 additions and 1 deletions

View file

@ -28,6 +28,7 @@ import {openDocHistory} from "../history/doc";
import {openEditorTab} from "./util";
import {makeCard} from "../card/makeCard";
import {transaction} from "../protyle/wysiwyg/transaction";
import {emitOpenMenu} from "../plugin/EventBus";
const initMultiMenu = (selectItemElements: NodeListOf<Element>, app: App) => {
const fileItemElement = Array.from(selectItemElements).find(item => {
@ -105,6 +106,17 @@ const initMultiMenu = (selectItemElements: NodeListOf<Element>, app: App) => {
icon: "iconRiffCard",
submenu: riffCardMenu,
}).element);
if (app.plugins) {
emitOpenMenu({
plugins: app.plugins,
type: "open-menu-doctree",
detail: {
elements: selectItemElements,
type: "docs"
},
separatorPosition: "top",
});
}
return window.siyuan.menus.menu;
};
@ -325,6 +337,17 @@ export const initNavigationMenu = (app: App, liElement: HTMLElement) => {
}
}]
}).element);
if (app.plugins) {
emitOpenMenu({
plugins: app.plugins,
type: "open-menu-doctree",
detail: {
elements: selectItemElements,
type: "notebook"
},
separatorPosition: "top",
});
}
return window.siyuan.menus.menu;
};
@ -594,6 +617,17 @@ export const initFileMenu = (app: App, notebookId: string, pathString: string, l
}
genImportMenu(notebookId, pathString);
window.siyuan.menus.menu.append(exportMd(id));
if (app.plugins) {
emitOpenMenu({
plugins: app.plugins,
type: "open-menu-doctree",
detail: {
elements: selectItemElements,
type: "doc"
},
separatorPosition: "top",
});
}
return window.siyuan.menus.menu;
};