Skip to content

Commit

Permalink
🎨 fix #9351
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Oct 5, 2023
1 parent e1d8a60 commit cd3642f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
34 changes: 34 additions & 0 deletions app/src/menus/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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;
};

Expand Down Expand Up @@ -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;
};

Expand Down Expand Up @@ -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;
};

Expand Down
2 changes: 1 addition & 1 deletion app/src/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" |
Expand Down

0 comments on commit cd3642f

Please sign in to comment.