         @openSelectedEntry(false) if entry instanceof FileView
         entry.toggleExpansion(isRecursive) if entry instanceof DirectoryView
       when 2
-        if entry.is('.selected.file')
+        if entry instanceof FileView
           atom.workspaceView.getActiveView()?.focus()
-        else if entry.is('.selected.directory')
+        else if DirectoryView
           entry.toggleExpansion(isRecursive)
 
     false

    @list.find('.selected')?.view()

  selectEntry: (entry) ->
    entry = entry?.view?()
    return false unless entry?

    @selectedPath = entry.getPath()
    @deselect()
    entry.addClass('selected')

  deselect: ->
    @list.find('.selected').removeClass('selected')

  scrollTop: (top) ->
    if top?

      atom.clipboard.write(pathToCopy)

  entryForPath: (entryPath) ->
    bestMatchEntry = @root
    for entry in @list.element.querySelectorAll('.entry')
      if entry.getPath() is entryPath
        bestMatchEntry = entry
        break
      else if entry.getPath().length > bestMatchEntry.getPath().length and entry.directory?.contains?(entryPath)
        bestMatchEntry = entry

    bestMatchEntry

  selectEntryForPath: (entryPath) ->
    @selectEntry(@entryForPath(entryPath))
