Merge branch 'master' of github.com:github/atom

This commit is contained in:
Nathan Sobo
2012-03-20 13:09:48 -06:00
2 changed files with 30 additions and 1 deletions

View File

@@ -16,10 +16,14 @@ class FileFinder extends View
initialize: ({@urls, @selected}) ->
requireStylesheet 'file-finder.css'
@maxResults = 10
@previousFocusedElement = $(document.activeElement)
@populateUrlList()
window.keymap.bindKeys ".file-finder .editor",
'enter': 'file-finder:select-file'
'enter': 'file-finder:select-file',
'escape': 'file-finder:close'
@on 'file-finder:close', => @remove()
@on 'move-up', => @moveUp()
@on 'move-down', => @moveDown()
@on 'file-finder:select-file', => @select()
@@ -43,6 +47,10 @@ class FileFinder extends View
@selected(filePath) if filePath and @selected
@remove()
remove: ->
super()
@previousFocusedElement.focus()
moveUp: ->
@findSelectedLi()
.filter(':not(:first-child)')