Skip to content
Snippets Groups Projects
Commit 466c9bd6 authored by David Sehnal's avatar David Sehnal
Browse files

mol-plugin: wip UI

parent 31bcc5a0
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,7 @@ import { AnimationControls } from './state/animation';
import { StateTree } from './state/tree';
import { BackgroundTaskProgress } from './task';
import { Viewport, ViewportControls } from './viewport';
import { StateTransform } from 'mol-state';
export class Plugin extends React.Component<{ plugin: PluginContext }, {}> {
......@@ -174,6 +175,14 @@ export class CurrentObject extends PluginUIComponent {
const def = transform.transformer.definition;
const display = cell.obj ? cell.obj.label : (def.display && def.display.name) || def.name;
let showActions = true;
if (ref === StateTransform.RootRef) {
const children = current.state.tree.children.get(ref);
showActions = children.size !== 0;
}
if (!showActions) return null;
return cell.status === 'ok' && <>
<div className='msp-section-header'>{`Actions (${display})`}</div>
<StateObjectActions state={current.state} nodeRef={ref} />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment