remove old code and select homepage at start

pull/1/head
yann300 6 years ago
parent 45b4408f13
commit 7734207757
  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 () { export function homepageProfile () {
return { return {
displayName: 'home page',
name: 'homepage', name: 'homepage',
methods: [], methods: [],
events: [], events: [],
@ -14,7 +15,7 @@ export function homepageProfile () {
} }
} }
export function generateHomePage (appManager) { export function generateHomePage (appManager, appStore) {
/* /*
var actions1 = [ var actions1 = [
{label: 'new file', type: `callback`, payload: () => { alert(`-new file created-`) }}, {label: 'new file', type: `callback`, payload: () => { alert(`-new file created-`) }},
@ -56,6 +57,14 @@ export function generateHomePage (appManager) {
*/ */
var sectionsWorkspaces = [] 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) => { defaultWorkspaces(appManager).forEach((workspace) => {
sectionsWorkspaces.push({label: workspace.title, type: 'callback', payload: () => { workspace.activate() }}) 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 [ return [
new Workspace('Close All Modules', '', () => {
appStore.getActives()
.filter(({profile}) => !profile.required)
.forEach((profile) => { appManager.deactivateOne(profile.name) })
}, () => {}),
new Workspace('Solidity Basic', '', () => { new Workspace('Solidity Basic', '', () => {
appManager.ensureActivated('solidity') appManager.ensureActivated('solidity')
}, () => {}), }, () => {}),

@ -2,27 +2,20 @@ export default {
start: (appStore, swapPanelApi, verticalIconApi, mainPanelApi, resizeFeature) => { start: (appStore, swapPanelApi, verticalIconApi, mainPanelApi, resizeFeature) => {
swapPanelApi.event.on('toggle', (moduleName) => { swapPanelApi.event.on('toggle', (moduleName) => {
resizeFeature.panel1.clientWidth !== 0 ? resizeFeature.minimize() : resizeFeature.maximise() resizeFeature.panel1.clientWidth !== 0 ? resizeFeature.minimize() : resizeFeature.maximise()
if (moduleName === 'fileExplorers') {
mainPanelApi.showContent('code editor')
}
}) })
swapPanelApi.event.on('showing', (moduleName) => { swapPanelApi.event.on('showing', (moduleName) => {
if (moduleName === 'fileExplorers') {
mainPanelApi.showContent('code editor')
}
resizeFeature.panel1.clientWidth === 0 ? resizeFeature.maximise() : '' resizeFeature.panel1.clientWidth === 0 ? resizeFeature.maximise() : ''
var current = appStore.getOne(moduleName) var current = appStore.getOne(moduleName)
// warn the content that it is being displayed. TODO should probably be done in each view // warn the content that it is being displayed. TODO should probably be done in each view
if (current && current.api.__showing) current.api.__showing() if (current && current.api.__showing) current.api.__showing()
}) })
mainPanelApi.event.on('toggle', () => { mainPanelApi.event.on('toggle', () => {
verticalIconApi.select('code editor')
resizeFeature.maximise() resizeFeature.maximise()
}) })
// mainPanelApi.event.on('showing', (moduleName) => {}) // mainPanelApi.event.on('showing', (moduleName) => {})
verticalIconApi.select('fileExplorers') verticalIconApi.select('fileExplorers')
verticalIconApi.select('homepage') mainPanelApi.showContent('homepage')
resizeFeature.minimize() resizeFeature.minimize()
} }
} }

Loading…
Cancel
Save