Skip to content
Snippets Groups Projects
Commit 8f4bf9a3 authored by Alexander Rose's avatar Alexander Rose
Browse files

added outsideControls to PluginLayoutStateParams

parent cca0f407
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,8 @@ import { PluginCommands } from './command';
// TODO: support collapsed state control orientation
export const PluginLayoutStateParams = {
isExpanded: PD.Boolean(false),
showControls: PD.Boolean(true)
showControls: PD.Boolean(true),
outsideControls: PD.Boolean(true, { isHidden: true })
}
export type PluginLayoutStateProps = PD.Values<typeof PluginLayoutStateParams>
......
......@@ -85,12 +85,30 @@ class Layout extends PluginUIComponent {
return classList.join(' ')
}
get layoutClassName() {
const layout = this.plugin.layout.state;
const classList: string[] = ['msp-plugin-content']
if (layout.isExpanded) {
classList.push('msp-layout-expanded')
} else {
classList.push('msp-layout-standard')
if (layout.outsideControls) {
classList.push('msp-layout-standard-outside')
} else {
classList.push('msp-layout-standard-landscape')
}
}
return classList.join(' ')
}
render() {
const layout = this.plugin.layout.state;
const controls = (this.plugin.spec.layout && this.plugin.spec.layout.controls) || { };
return <div className='msp-plugin'>
<div className={`msp-plugin-content ${layout.isExpanded ? 'msp-layout-expanded' : 'msp-layout-standard msp-layout-standard-outside'}`}>
<div className={this.layoutClassName}>
<div className={this.layoutVisibilityClassName}>
{this.region('main', ViewportWrapper)}
{layout.showControls && controls.top !== 'none' && this.region('top', controls.top || SequenceView)}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment