Convert more fuzzy finder behavior to inherit from SelectList

This commit is contained in:
Nathan Sobo
2012-10-03 19:05:53 -10:00
parent 7f3165fa7b
commit 74c5be4632
2 changed files with 16 additions and 76 deletions

View File

@@ -32,7 +32,13 @@ class FuzzyFinder extends SelectList
itemForElement: (path) ->
$$ -> @li path
confirmed: (path) ->
confirmed : (path) ->
return unless path.length
@rootView.open(path, {@allowActiveEditorChange})
@detach()
cancelled: ->
@rootView.focus()
toggleFileFinder: ->
if @hasParent()
@@ -62,13 +68,6 @@ class FuzzyFinder extends SelectList
attach: ->
@rootView.append(this)
@miniEditor.focus()
@miniEditor.on 'focusout', => @detach()
detach: ->
@miniEditor.off 'focusout'
@rootView.focus()
super
@miniEditor.setText('')
populatePathList: ->
@pathList.empty()
@@ -80,10 +79,6 @@ class FuzzyFinder extends SelectList
findSelectedLi: ->
@pathList.children('li.selected')
confirmed : (path) ->
return unless path.length
@rootView.open(path, {@allowActiveEditorChange})
@detach()
entryClicked: (e) ->
@open($(e.currentTarget).text())