remove old code and select homepage at start

pull/3094/head
yann300 6 years ago
parent 98f5f2cef2
commit 8976c5be0a
  1. 11
      src/app/ui/landing-page/generate.js
  2. 7
      src/app/ui/landing-page/workspace.js
  3. 9
      src/framingService.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() }})
})

@ -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')
}, () => {}),

@ -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()
}
}

Loading…
Cancel
Save