Commit 9c380339 authored by LianaHus's avatar LianaHus

removed 'focus' event registration to explorer

parent ce5e0580
...@@ -62,6 +62,10 @@ function fileExplorer (localRegistry, files, menuItems) { ...@@ -62,6 +62,10 @@ function fileExplorer (localRegistry, files, menuItems) {
fileManager: self._components.registry.get('filemanager').api 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}` }) self._components.registry.put({ api: self, name: `fileexplorer/${self.files.type}` })
// warn if file changed outside of Remix // warn if file changed outside of Remix
......
...@@ -56,7 +56,7 @@ module.exports = class Filepanel extends ViewPlugin { ...@@ -56,7 +56,7 @@ module.exports = class Filepanel extends ViewPlugin {
['createNewFile', 'publishToGist', 'copyFiles', canUpload ? 'uploadFile' : ''] ['createNewFile', 'publishToGist', 'copyFiles', canUpload ? 'uploadFile' : '']
) )
function createProvider(key) { function createProvider (key) {
return new FileExplorer(self._components.registry, self._deps.fileProviders[key]) return new FileExplorer(self._components.registry, self._deps.fileProviders[key])
} }
...@@ -113,38 +113,6 @@ module.exports = class Filepanel extends ViewPlugin { ...@@ -113,38 +113,6 @@ module.exports = class Filepanel extends ViewPlugin {
fileSystemExplorer.hide() 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 } self.render = function render () { return element }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment