diff --git a/src/app/ui/landing-page/generate.js b/src/app/ui/landing-page/generate.js index fc14675708..4108d0d4d3 100644 --- a/src/app/ui/landing-page/generate.js +++ b/src/app/ui/landing-page/generate.js @@ -5,6 +5,7 @@ import { defaultWorkspaces } from './workspace' export function homepageProfile () { return { + displayName: 'home page', name: 'homepage', methods: [], events: [], @@ -14,7 +15,7 @@ export function homepageProfile () { } } -export function generateHomePage (appManager) { +export function generateHomePage (appManager, appStore) { /* var actions1 = [ {label: 'new file', type: `callback`, payload: () => { alert(`-new file created-`) }}, @@ -56,6 +57,14 @@ export function generateHomePage (appManager) { */ var sectionsWorkspaces = [] + sectionsWorkspaces.push({ + label: 'Close All Modules', + type: 'callback', + payload: () => { + appStore.getActives() + .filter(({profile}) => !profile.required) + .forEach((profile) => { appManager.deactivateOne(profile.name) }) + }}) defaultWorkspaces(appManager).forEach((workspace) => { sectionsWorkspaces.push({label: workspace.title, type: 'callback', payload: () => { workspace.activate() }}) }) diff --git a/src/app/ui/landing-page/workspace.js b/src/app/ui/landing-page/workspace.js index 2f8399bfe3..c12b7dc657 100644 --- a/src/app/ui/landing-page/workspace.js +++ b/src/app/ui/landing-page/workspace.js @@ -7,13 +7,8 @@ export class Workspace { } } -export const defaultWorkspaces = (appManager, appStore) => { +export const defaultWorkspaces = (appManager) => { return [ - new Workspace('Close All Modules', '', () => { - appStore.getActives() - .filter(({profile}) => !profile.required) - .forEach((profile) => { appManager.deactivateOne(profile.name) }) - }, () => {}), new Workspace('Solidity Basic', '', () => { appManager.ensureActivated('solidity') }, () => {}), diff --git a/src/framingService.js b/src/framingService.js index e39bebbb19..50f9e6feb5 100644 --- a/src/framingService.js +++ b/src/framingService.js @@ -2,27 +2,20 @@ export default { start: (appStore, swapPanelApi, verticalIconApi, mainPanelApi, resizeFeature) => { swapPanelApi.event.on('toggle', (moduleName) => { resizeFeature.panel1.clientWidth !== 0 ? resizeFeature.minimize() : resizeFeature.maximise() - if (moduleName === 'fileExplorers') { - mainPanelApi.showContent('code editor') - } }) swapPanelApi.event.on('showing', (moduleName) => { - if (moduleName === 'fileExplorers') { - mainPanelApi.showContent('code editor') - } resizeFeature.panel1.clientWidth === 0 ? resizeFeature.maximise() : '' var current = appStore.getOne(moduleName) // 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('toggle', () => { - verticalIconApi.select('code editor') resizeFeature.maximise() }) // mainPanelApi.event.on('showing', (moduleName) => {}) verticalIconApi.select('fileExplorers') - verticalIconApi.select('homepage') + mainPanelApi.showContent('homepage') resizeFeature.minimize() } }