             @props.actions.set_file_search
         else if not @props.files_displayed and @props.file_search?.length > 0
             if @props.file_search[@props.file_search.length - 1] == '/'
-                @create_folder()
+                @props.create_folder()
             else
-                @create_file()
+                @props.create_file()
 
     render : ->
         <span>

            # Tell state to render an error in file search
            @props.actions.setState(create_file_alert : true)
        else
            @create_file(ext)

    # Go to new file tab if no file is specified
    handle_file_click : ->
        if @props.file_search.length == 0
            @props.actions.set_focused_page('project-new-file')
        else
            @create_file()

    create_file : (ext) ->
        if not ext and @props.file_search?.indexOf('.') == -1
            ext = "sagews"
        @props.actions.create_file
            name         : @props.file_search
            ext          : ext
            current_path : @props.current_path
            on_download  : ((a) => @setState(download: a))
            on_error     : ((a) => @setState(error: a))
        @props.actions.setState(file_search : '', page_number: 0)

    create_folder : ->
        @props.actions.create_folder(@props.file_search, @props.current_path, (a) => @setState(error: a))

    render : ->
        # This div prevents the split button from line-breaking when the page is small

        file_search  : rtypes.string.isRequired
        current_path : rtypes.string
        actions      : rtypes.object.isRequired
        create_folder : rtypes.func.isRequired
        create_file   : rtypes.func.isRequired

    getDefaultProps : ->
        file_search : ''
