mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
@@ -39,28 +39,26 @@ class FuzzyFinderView extends SelectList
|
||||
itemForElement: (path) ->
|
||||
$$ ->
|
||||
@li =>
|
||||
typeClass = null
|
||||
if git?
|
||||
status = git.statuses[project.resolve(path)]
|
||||
if git.isStatusNew(status)
|
||||
typeClass = 'new'
|
||||
@div class: 'status new'
|
||||
else if git.isStatusModified(status)
|
||||
typeClass = 'modified'
|
||||
@div class: 'status modified'
|
||||
|
||||
unless typeClass
|
||||
ext = fs.extension(path)
|
||||
if fs.isReadmePath(path)
|
||||
typeClass = 'readme-name'
|
||||
else if fs.isCompressedExtension(ext)
|
||||
typeClass = 'compressed-name'
|
||||
else if fs.isImageExtension(ext)
|
||||
typeClass = 'image-name'
|
||||
else if fs.isPdfExtension(ext)
|
||||
typeClass = 'pdf-name'
|
||||
else if fs.isBinaryExtension(ext)
|
||||
typeClass = 'binary-name'
|
||||
else
|
||||
typeClass = 'text-name'
|
||||
ext = fs.extension(path)
|
||||
if fs.isReadmePath(path)
|
||||
typeClass = 'readme-name'
|
||||
else if fs.isCompressedExtension(ext)
|
||||
typeClass = 'compressed-name'
|
||||
else if fs.isImageExtension(ext)
|
||||
typeClass = 'image-name'
|
||||
else if fs.isPdfExtension(ext)
|
||||
typeClass = 'pdf-name'
|
||||
else if fs.isBinaryExtension(ext)
|
||||
typeClass = 'binary-name'
|
||||
else
|
||||
typeClass = 'text-name'
|
||||
|
||||
@span fs.base(path), class: "file label #{typeClass}"
|
||||
if folder = fs.directory(path)
|
||||
|
||||
@@ -446,8 +446,8 @@ describe 'FuzzyFinder', ->
|
||||
git.getPathStatus(editor.getPath())
|
||||
|
||||
rootView.trigger 'fuzzy-finder:toggle-buffer-finder'
|
||||
expect(finderView.find('.file.modified').length).toBe 1
|
||||
expect(finderView.find('.file.modified').text()).toBe 'sample.js'
|
||||
expect(finderView.find('.status.modified').length).toBe 1
|
||||
expect(finderView.find('.status.modified').closest('li').find('.file').text()).toBe 'sample.js'
|
||||
|
||||
|
||||
describe "when a new file is shown in the list", ->
|
||||
@@ -456,5 +456,5 @@ describe 'FuzzyFinder', ->
|
||||
git.getPathStatus(editor.getPath())
|
||||
|
||||
rootView.trigger 'fuzzy-finder:toggle-buffer-finder'
|
||||
expect(finderView.find('.file.new').length).toBe 1
|
||||
expect(finderView.find('.file.new').text()).toBe 'newsample.js'
|
||||
expect(finderView.find('.status.new').length).toBe 1
|
||||
expect(finderView.find('.status.new').closest('li').find('.file').text()).toBe 'newsample.js'
|
||||
|
||||
Reference in New Issue
Block a user