1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
18 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
19 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
20 | else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
21 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
22 | };
|
23 | var __metadata = (this && this.__metadata) || function (k, v) {
|
24 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
25 | };
|
26 | var __param = (this && this.__param) || function (paramIndex, decorator) {
|
27 | return function (target, key) { decorator(target, key, paramIndex); }
|
28 | };
|
29 | Object.defineProperty(exports, "__esModule", { value: true });
|
30 | exports.BrowserContextMenuRenderer = exports.BrowserContextMenuAccess = void 0;
|
31 | const inversify_1 = require("inversify");
|
32 | const context_menu_renderer_1 = require("../context-menu-renderer");
|
33 | const browser_menu_plugin_1 = require("./browser-menu-plugin");
|
34 | class BrowserContextMenuAccess extends context_menu_renderer_1.ContextMenuAccess {
|
35 | constructor(menu) {
|
36 | super(menu);
|
37 | this.menu = menu;
|
38 | }
|
39 | }
|
40 | exports.BrowserContextMenuAccess = BrowserContextMenuAccess;
|
41 | let BrowserContextMenuRenderer = class BrowserContextMenuRenderer extends context_menu_renderer_1.ContextMenuRenderer {
|
42 | constructor(menuFactory) {
|
43 | super();
|
44 | this.menuFactory = menuFactory;
|
45 | }
|
46 | doRender({ menuPath, anchor, args, onHide, context, contextKeyService }) {
|
47 | const contextMenu = this.menuFactory.createContextMenu(menuPath, args, context, contextKeyService);
|
48 | const { x, y } = (0, context_menu_renderer_1.coordinateFromAnchor)(anchor);
|
49 | if (onHide) {
|
50 | contextMenu.aboutToClose.connect(() => onHide());
|
51 | }
|
52 | contextMenu.open(x, y);
|
53 | return new BrowserContextMenuAccess(contextMenu);
|
54 | }
|
55 | };
|
56 | BrowserContextMenuRenderer = __decorate([
|
57 | (0, inversify_1.injectable)(),
|
58 | __param(0, (0, inversify_1.inject)(browser_menu_plugin_1.BrowserMainMenuFactory)),
|
59 | __metadata("design:paramtypes", [browser_menu_plugin_1.BrowserMainMenuFactory])
|
60 | ], BrowserContextMenuRenderer);
|
61 | exports.BrowserContextMenuRenderer = BrowserContextMenuRenderer;
|
62 |
|
\ | No newline at end of file |