From 28ddc2cbe0d9b3d885b6a18e8543e09f6dfd2807 Mon Sep 17 00:00:00 2001 From: anijanyan Date: Mon, 12 Aug 2024 18:23:22 +0400 Subject: [PATCH] open file fixed --- package-lock.json | 2 +- packages/ace-layout/package.json | 2 +- packages/ace-layout/widgets/tabs/tabManager.ts | 10 ++++++++++ packages/demo/simple/demo.ts | 6 ------ 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index b65d464..f45ca51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4389,7 +4389,7 @@ "extraneous": true }, "packages/ace-layout": { - "version": "1.4.0", + "version": "1.4.2", "license": "MIT", "devDependencies": { "ace-code": "^1.35.2", diff --git a/packages/ace-layout/package.json b/packages/ace-layout/package.json index 064285a..6d65252 100644 --- a/packages/ace-layout/package.json +++ b/packages/ace-layout/package.json @@ -1,6 +1,6 @@ { "name": "ace-layout", - "version": "1.4.0", + "version": "1.4.2", "author": "Ani Amirjanyan ", "scripts": { "build": "webpack" diff --git a/packages/ace-layout/widgets/tabs/tabManager.ts b/packages/ace-layout/widgets/tabs/tabManager.ts index 1b960e7..0aef524 100644 --- a/packages/ace-layout/widgets/tabs/tabManager.ts +++ b/packages/ace-layout/widgets/tabs/tabManager.ts @@ -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() { diff --git a/packages/demo/simple/demo.ts b/packages/demo/simple/demo.ts index 943eb2a..47b9d1b 100644 --- a/packages/demo/simple/demo.ts +++ b/packages/demo/simple/demo.ts @@ -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,