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

38 lines
1.2 KiB

export class FramingService {
constructor (sidePanel, verticalIcon, mainView, resizeFeature) {
this.sidePanel = sidePanel
this.verticalIcon = verticalIcon
this.mainPanel = mainView.getAppPanel()
this.mainView = mainView
this.resizeFeature = resizeFeature
}
start () {
this.sidePanel.events.on('toggle', () => {
this.resizeFeature.panel1.clientWidth !== 0 ? this.resizeFeature.minimize() : this.resizeFeature.maximise()
})
this.sidePanel.events.on('showing', () => {
this.resizeFeature.panel1.clientWidth === 0 ? this.resizeFeature.maximise() : ''
})
this.mainPanel.events.on('toggle', () => {
this.resizeFeature.maximise()
6 years ago
})
this.verticalIcon.select('fileExplorers')
document.addEventListener('keypress', (e) => {
if (e.shiftKey && e.ctrlKey) {
if (e.code === 'KeyF') { // Ctrl+Shift+F
this.verticalIcon.select('fileExplorers')
} else if (e.code === 'KeyA') { // Ctrl+Shift+A
this.verticalIcon.select('pluginManager')
} else if (e.code === 'KeyS') { // Ctrl+Shift+S
this.verticalIcon.select('settings')
}
e.preventDefault()
}
})
}
}