From 9c380339cecf37b3f3d1a8b0668dadcc64ca7d14 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Wed, 11 Sep 2019 14:32:00 +0200 Subject: [PATCH] removed 'focus' event registration to explorer --- src/app/files/file-explorer.js | 4 ++++ src/app/panels/file-panel.js | 34 +--------------------------------- 2 files changed, 5 insertions(+), 33 deletions(-) diff --git a/src/app/files/file-explorer.js b/src/app/files/file-explorer.js index 0eb005bf8b..6cea03215e 100644 --- a/src/app/files/file-explorer.js +++ b/src/app/files/file-explorer.js @@ -62,6 +62,10 @@ function fileExplorer (localRegistry, files, menuItems) { fileManager: self._components.registry.get('filemanager').api } + self.events.register('focus', function (path) { + self._deps.fileManager.switchFile(path) + }) + self._components.registry.put({ api: self, name: `fileexplorer/${self.files.type}` }) // warn if file changed outside of Remix diff --git a/src/app/panels/file-panel.js b/src/app/panels/file-panel.js index 90d96be710..af991118be 100644 --- a/src/app/panels/file-panel.js +++ b/src/app/panels/file-panel.js @@ -56,7 +56,7 @@ module.exports = class Filepanel extends ViewPlugin { ['createNewFile', 'publishToGist', 'copyFiles', canUpload ? 'uploadFile' : ''] ) - function createProvider(key) { + function createProvider (key) { return new FileExplorer(self._components.registry, self._deps.fileProviders[key]) } @@ -113,38 +113,6 @@ module.exports = class Filepanel extends ViewPlugin { fileSystemExplorer.hide() }) - fileExplorer.events.register('focus', function (path) { - self._deps.fileManager.switchFile(path) - }) - - fileSystemExplorer.events.register('focus', function (path) { - self._deps.fileManager.switchFile(path) - }) - - swarmExplorer.events.register('focus', function (path) { - self._deps.fileManager.switchFile(path) - }) - - githubExplorer.events.register('focus', function (path) { - self._deps.fileManager.switchFile(path) - }) - - gistExplorer.events.register('focus', function (path) { - self._deps.fileManager.switchFile(path) - }) - - httpExplorer.events.register('focus', function (path) { - self._deps.fileManager.switchFile(path) - }) - - httpsExplorer.events.register('focus', function (path) { - self._deps.fileManager.switchFile(path) - }) - - ipfsExplorer.events.register('focus', function (path) { - self._deps.fileManager.switchFile(path) - }) - self.render = function render () { return element } } }