mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
This commit is contained in:
parent
e1d8a609d0
commit
cd3642f0f9
2 changed files with 35 additions and 1 deletions
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
|||
2
app/src/types/index.d.ts
vendored
2
app/src/types/index.d.ts
vendored
|
|
@ -46,7 +46,7 @@ type TEventBus = "ws-main" |
|
|||
"click-blockicon" | "click-editorcontent" | "click-pdf" | "click-editortitleicon" |
|
||||
"open-noneditableblock" |
|
||||
"open-menu-blockref" | "open-menu-fileannotationref" | "open-menu-tag" | "open-menu-link" | "open-menu-image" |
|
||||
"open-menu-av" | "open-menu-content" | "open-menu-breadcrumbmore" |
|
||||
"open-menu-av" | "open-menu-content" | "open-menu-breadcrumbmore" | "open-menu-doctree" |
|
||||
"open-siyuan-url-plugin" | "open-siyuan-url-block" |
|
||||
"input-search" |
|
||||
"loaded-protyle" | "loaded-protyle-dynamic" |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue