Browse Source

mol-plugin: tree UI fix

David Sehnal 6 years ago
parent
commit
bbd7f43fc1
2 changed files with 5 additions and 5 deletions
  1. 3 3
      src/mol-plugin/ui/plugin.tsx
  2. 2 2
      src/mol-plugin/ui/state/tree.tsx

+ 3 - 3
src/mol-plugin/ui/plugin.tsx

@@ -185,9 +185,9 @@ export class CurrentObject extends PluginUIComponent {
 
         if (!showActions) return null;
 
-        return cell.status === 'ok' && <>
-            <UpdateTransformContol state={current.state} transform={transform} />
-            <StateObjectActions state={current.state} nodeRef={ref} />
+        return <>
+            {(cell.status === 'ok' || cell.status == 'error') && <UpdateTransformContol state={current.state} transform={transform} /> }
+            {cell.status === 'ok' && <StateObjectActions state={current.state} nodeRef={ref} />}
         </>;
     }
 }

+ 2 - 2
src/mol-plugin/ui/state/tree.tsx

@@ -214,8 +214,8 @@ class StateTreeNodeLabel extends PluginUIComponent<
             label = <><b>[{cell.status}]</b> <span title={name}>{name}</span></>;
         } else if (cell.status !== 'ok' || !cell.obj) {
             const name = n.transformer.definition.display.name;
-            const title = `${cell.errorText}`
-            label = <><b>[{cell.status}]</b> <a title={title} href='#' onClick={this.setCurrent}>{name}</a>: <i>{cell.errorText}</i></>;
+            const title = `${cell.errorText}`;
+            label = <><a title={title} href='#' onClick={this.setCurrent}><b>[{cell.status}]</b> {name}: <i>{cell.errorText}</i> </a></>;
         } else {
             const obj = cell.obj as PluginStateObject.Any;
             const title = `${obj.label} ${obj.description ? obj.description : ''}`