1 |
|
2 |
|
3 | import { RankedMenu } from '@jupyterlab/ui-components';
|
4 | import { find } from '@lumino/algorithm';
|
5 |
|
6 |
|
7 |
|
8 | export class FileMenu extends RankedMenu {
|
9 | constructor(options) {
|
10 | super(options);
|
11 | this.quitEntry = false;
|
12 |
|
13 | this.closeAndCleaners = new Set();
|
14 | this.consoleCreators = new Set();
|
15 | }
|
16 | |
17 |
|
18 |
|
19 | get newMenu() {
|
20 | var _a, _b;
|
21 | if (!this._newMenu) {
|
22 | this._newMenu = (_b = (_a = find(this.items, menu => { var _a; return ((_a = menu.submenu) === null || _a === void 0 ? void 0 : _a.id) === 'jp-mainmenu-file-new'; })) === null || _a === void 0 ? void 0 : _a.submenu) !== null && _b !== void 0 ? _b : new RankedMenu({
|
23 | commands: this.commands
|
24 | });
|
25 | }
|
26 | return this._newMenu;
|
27 | }
|
28 | |
29 |
|
30 |
|
31 | dispose() {
|
32 | var _a;
|
33 | (_a = this._newMenu) === null || _a === void 0 ? void 0 : _a.dispose();
|
34 | this.consoleCreators.clear();
|
35 | super.dispose();
|
36 | }
|
37 | }
|
38 |
|
\ | No newline at end of file |