Skip to content

Commit

Permalink
open file fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
anijanyan committed Aug 12, 2024
1 parent 72bbf3c commit 28ddc2c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/ace-layout/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ace-layout",
"version": "1.4.0",
"version": "1.4.2",
"author": "Ani Amirjanyan <[email protected]>",
"scripts": {
"build": "webpack"
Expand Down
10 changes: 10 additions & 0 deletions packages/ace-layout/widgets/tabs/tabManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ export class TabManager {
this.tabs = {};
this.fileSystem = options.fileSystem;
this.commandsInit();
this.initFileSystem();
}

private initFileSystem() {
this.fileSystem?.on("openFile", (treeNode, fileContent) => {
this.open({
path: treeNode.path,
title: treeNode.path.split('/').pop()
}, undefined, fileContent);
});
}

commandsInit() {
Expand Down
6 changes: 0 additions & 6 deletions packages/demo/simple/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ let tabManager = TabManager.getInstance({
},
fileSystem: fileSystem
});
tabManager.fileSystem?.on("openFile", (treeNode, fileContent) => {
tabManager.open({
path: treeNode.path,
title: treeNode.path.split('/').pop()
}, undefined, fileContent);
});

let panelManager = PanelManager.getInstance({
layout: base,
Expand Down

0 comments on commit 28ddc2c

Please sign in to comment.