(menu: ContextMenuItem[], ev: React.MouseEvent<any>, opts?: ShowContextMenuOpts)
| 69 | } |
| 70 | |
| 71 | showContextMenu(menu: ContextMenuItem[], ev: React.MouseEvent<any>, opts?: ShowContextMenuOpts): void { |
| 72 | ev.stopPropagation(); |
| 73 | this.handlers.clear(); |
| 74 | this.activeOpts = opts; |
| 75 | const electronMenuItems = this._convertAndRegisterMenu(menu); |
| 76 | |
| 77 | const workspaceId = globalStore.get(atoms.workspaceId); |
| 78 | let oid: string; |
| 79 | |
| 80 | if (workspaceId != null) { |
| 81 | oid = workspaceId; |
| 82 | } else { |
| 83 | oid = globalStore.get(atoms.builderId); |
| 84 | } |
| 85 | |
| 86 | getApi().showContextMenu(oid, electronMenuItems); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | export { ContextMenuModel }; |
no test coverage detected