 
     handle_click: (e) ->
         if window.getSelection().toString() == @state.selection_at_last_mouse_down
-            path = misc.path_to_file(@props.current_path, @props.name)
-            @props.actions.open_directory(path)
+            @props.actions.open_directory(@full_path())
             @props.actions.set_file_search('')
 
     render_public_directory_info: ->
         if @props.public_data? and @props.is_public
             <PublicButton
                 id       = {@props.name}
-                on_click = {generate_on_share_click(@props.name, @props.actions)}
+                on_click = {generate_on_share_click(@full_path(), @props.actions)}
             />
         else
             <ShareButton
                 id       = {@props.name}
-                on_click = {generate_on_share_click(@props.name, @props.actions)}
+                on_click = {generate_on_share_click(@full_path(), @props.actions)}
             />
+
+    full_path: ->
+        misc.path_to_file(@props.current_path, @props.name)
 
     render_time: ->
         if @props.time?


        # See https://github.com/sagemathinc/cocalc/issues/1020
        # support right-click → copy url for the download button
        url_href = project_tasks(@props.actions.project_id).url_href(@fullpath())

        <Row
            style       = {row_styles}

            </Button>
        </span>

generate_on_share_click = (full_path, actions) =>
    (e) =>
        e.preventDefault()
        e.stopPropagation()
        actions.set_all_files_unchecked()
        actions.set_file_checked(full_path, true)
        actions.set_file_action('share')

FileRow = rclass
