|
@@ -11,7 +11,7 @@ import { State, StateAction } from '../../../mol-state';
|
|
|
import { Icon } from '../controls/common';
|
|
|
import { PluginContext } from '../../context';
|
|
|
|
|
|
-export class StateObjectActions extends PluginUIComponent<{ state: State, nodeRef: string, hideHeader?: boolean, initiallyCollapsed?: boolean }> {
|
|
|
+export class StateObjectActions extends PluginUIComponent<{ state: State, nodeRef: string, hideHeader?: boolean, initiallyCollapsed?: boolean, alwaysExpandFirst?: boolean }> {
|
|
|
get current() {
|
|
|
return this.plugin.state.behavior.currentObject.value;
|
|
|
}
|
|
@@ -40,7 +40,9 @@ export class StateObjectActions extends PluginUIComponent<{ state: State, nodeRe
|
|
|
|
|
|
return <div className='msp-state-actions'>
|
|
|
{!this.props.hideHeader && <div className='msp-section-header'><Icon name='code' /> {`Actions (${display})`}</div> }
|
|
|
- {actions.map((act, i) => <ApplyActionControl plugin={this.plugin} key={`${act.id}`} state={state} action={act} nodeRef={ref} initiallyCollapsed={this.props.initiallyCollapsed} />)}
|
|
|
+ {actions.map((act, i) => <ApplyActionControl
|
|
|
+ plugin={this.plugin} key={`${act.id}`} state={state} action={act} nodeRef={ref}
|
|
|
+ initiallyCollapsed={i === 0 ? !this.props.alwaysExpandFirst && this.props.initiallyCollapsed : this.props.initiallyCollapsed} />)}
|
|
|
</div>;
|
|
|
}
|
|
|
}
|