diff --git a/src/app/components/swap-panel-api.js b/src/app/components/swap-panel-api.js index f603dfedc3..9b2f8cc3bf 100644 --- a/src/app/components/swap-panel-api.js +++ b/src/app/components/swap-panel-api.js @@ -8,17 +8,17 @@ class SwapPanelApi { verticalIconsComponent.event.on('showContent', (moduleName) => { if (!swapPanelComponent.contents[moduleName]) return if (this.currentContent === moduleName) { - this.event.emit('toggle') + this.event.emit('toggle', moduleName) return } + this.showContent(moduleName) this.event.emit('showing', moduleName) - this.component.showContent(moduleName) - this.currentContent = moduleName }) } showContent (moduleName) { this.component.showContent(moduleName) + this.currentContent = moduleName } /* diff --git a/src/framingService.js b/src/framingService.js index bb15139d32..fa50132742 100644 --- a/src/framingService.js +++ b/src/framingService.js @@ -1,15 +1,11 @@ export default { start: (appStore, swapPanelApi, verticalIconApi, mainPanelApi, resizeFeature) => { - swapPanelApi.event.on('toggle', () => { + swapPanelApi.event.on('toggle', (moduleName) => { resizeFeature.panel1.clientWidth !== 0 ? resizeFeature.minimize() : resizeFeature.maximise() if (moduleName === 'file explorers') { mainPanelApi.showContent('code editor') } }) - mainPanelApi.event.on('toggle', () => { - verticalIconApi.select('code editor') - resizeFeature.maximise() - }) swapPanelApi.event.on('showing', (moduleName) => { if (moduleName === 'file explorers') { mainPanelApi.showContent('code editor') @@ -19,10 +15,14 @@ export default { // warn the content that it is being displayed. TODO should probably be done in each view if (current && current.api.__showing) current.api.__showing() }) - mainPanelApi.event.on('showing', (moduleName) => {}) + mainPanelApi.event.on('toggle', () => { + verticalIconApi.select('code editor') + resizeFeature.maximise() + }) + // mainPanelApi.event.on('showing', (moduleName) => {}) verticalIconApi.select('file explorers') - resizeFeature.minimize() verticalIconApi.select('homepage') + resizeFeature.minimize() } }