Correctly focus fuzzy-finder/event-palette when triggered while other is showing

When canceling the fuzzy finder or event palette, we should only focus the root view / previous element if the mini editor is still focused. Otherwise, it was a change of focus elsewhere that caused us to be cancelled, and we don't want to interfere with that focus change.
This commit is contained in:
Nathan Sobo
2012-10-04 10:03:58 -10:00
parent b979c2f671
commit fc318ce5e9
3 changed files with 3 additions and 3 deletions

View File

@@ -89,7 +89,7 @@ class SelectList extends View
cancel: ->
@cancelling = true
@detach()
@cancelled()
@detach()
@cancelling = false

View File

@@ -47,5 +47,5 @@ class EventPalette extends SelectList
@previouslyFocusedElement.trigger(eventName)
cancelled: ->
@previouslyFocusedElement.focus()
@previouslyFocusedElement.focus() if @miniEditor.isFocused

View File

@@ -34,7 +34,7 @@ class FuzzyFinder extends SelectList
cancelled: ->
@miniEditor.setText('')
@rootView.focus()
@rootView.focus() if @miniEditor.isFocused
toggleFileFinder: ->
if @hasParent()