Skip to content

Commit

Permalink
🎨 Add plugin event bus open-menu-inbox (#9967)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuoqiu-Yingyi authored Dec 26, 2023
1 parent 171b915 commit a47e477
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions app/src/layout/dock/Inbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {App} from "../../index";
import {getCloudURL} from "../../config/util/about";
import {hasClosestByClassName} from "../../protyle/util/hasClosest";
import {escapeHtml} from "../../util/escape";
import {emitOpenMenu} from "../../plugin/EventBus";

export class Inbox extends Model {
private element: Element;
Expand Down Expand Up @@ -294,6 +295,17 @@ ${data.shorthandContent}
}
}).element);
}
if (this.app.plugins) {
emitOpenMenu({
plugins: this.app.plugins,
type: "open-menu-inbox",
detail: {
ids,
element: itemElement || detailsElement,
},
separatorPosition: "top",
});
}
window.siyuan.menus.menu.popup({x: event.clientX, y: event.clientY + 16});
}

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 @@ -56,7 +56,7 @@ type TEventBus = "ws-main" | "sync-start" | "sync-end" | "sync-fail" |
"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-doctree" |
"open-menu-av" | "open-menu-content" | "open-menu-breadcrumbmore" | "open-menu-doctree" | "open-menu-inbox" |
"open-siyuan-url-plugin" | "open-siyuan-url-block" |
"paste" |
"input-search" |
Expand Down

0 comments on commit a47e477

Please sign in to comment.