remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
remix-project/src/framingService.js

29 lines
1.1 KiB

export default {
start: (appStore, swapPanelApi, verticalIconApi, mainPanelApi, resizeFeature) => {
6 years ago
swapPanelApi.event.on('toggle', (moduleName) => {
resizeFeature.panel1.clientWidth !== 0 ? resizeFeature.minimize() : resizeFeature.maximise()
if (moduleName === 'file explorers') {
mainPanelApi.showContent('code editor')
}
})
swapPanelApi.event.on('showing', (moduleName) => {
if (moduleName === 'file explorers') {
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()
})
6 years ago
mainPanelApi.event.on('toggle', () => {
verticalIconApi.select('code editor')
resizeFeature.maximise()
})
// mainPanelApi.event.on('showing', (moduleName) => {})
verticalIconApi.select('file explorers')
verticalIconApi.select('homepage')
6 years ago
resizeFeature.minimize()
}
}