X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/9b423a1e4ac7aa6077399da13a3d786df0eed11c..c2203b1706178b03dca89376f4cef84ccd882538:/src/components/file-tree/file-tree.tsx

diff --git a/src/components/file-tree/file-tree.tsx b/src/components/file-tree/file-tree.tsx
index bb70f25c..ad7ac73e 100644
--- a/src/components/file-tree/file-tree.tsx
+++ b/src/components/file-tree/file-tree.tsx
@@ -9,9 +9,11 @@ import { FileTreeItem } from "./file-tree-item";
 
 export interface FileTreeProps {
     items: Array<TreeItem<FileTreeData>>;
-    onContextMenu: (event: React.MouseEvent<HTMLElement>, item: TreeItem<FileTreeData>) => void;
+    onMenuOpen: (event: React.MouseEvent<HTMLElement>, item: TreeItem<FileTreeData>) => void;
     onSelectionToggle: (event: React.MouseEvent<HTMLElement>, item: TreeItem<FileTreeData>) => void;
     onCollapseToggle: (id: string, status: TreeItemStatus) => void;
+    onFileClick: (id: string) => void;
+    currentItemUuid?: string;
 }
 
 export class FileTree extends React.Component<FileTreeProps> {
@@ -24,19 +26,22 @@ export class FileTree extends React.Component<FileTreeProps> {
             onContextMenu={this.handleContextMenu}
             toggleItemActive={this.handleToggleActive}
             toggleItemOpen={this.handleToggle}
-            onSelectionChange={this.handleSelectionChange} />;
+            toggleItemSelection={this.handleSelectionChange} 
+            currentItemUuid={this.props.currentItemUuid} />;
     }
 
     handleContextMenu = (event: React.MouseEvent<any>, item: TreeItem<FileTreeData>) => {
         event.stopPropagation();
-        this.props.onContextMenu(event, item);
+        this.props.onMenuOpen(event, item);
     }
 
-    handleToggle = (id: string, status: TreeItemStatus) => {
+    handleToggle = (event: React.MouseEvent<{}>, { id, status }: TreeItem<{}>) => {
         this.props.onCollapseToggle(id, status);
     }
 
-    handleToggleActive = () => { return; };
+    handleToggleActive = (_: React.MouseEvent<HTMLElement>, item: TreeItem<FileTreeData>) => {
+        this.props.onFileClick(item.id);
+    }
 
     handleSelectionChange = (event: React.MouseEvent<HTMLElement>, item: TreeItem<FileTreeData>) => {
         event.stopPropagation();
