mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Don't detach on focusout when detaching
This commit is contained in:
@@ -13,9 +13,11 @@ class GoToLineView extends View
|
||||
@subview 'miniEditor', new Editor(mini: true)
|
||||
@div class: 'message', outlet: 'message'
|
||||
|
||||
detaching: false
|
||||
|
||||
initialize: ->
|
||||
rootView.command 'editor:go-to-line', '.editor', => @toggle()
|
||||
@miniEditor.on 'focusout', => @detach()
|
||||
@miniEditor.on 'focusout', => @detach() unless @detaching
|
||||
@on 'core:confirm', => @confirm()
|
||||
@on 'core:cancel', => @detach()
|
||||
|
||||
@@ -29,13 +31,15 @@ class GoToLineView extends View
|
||||
@attach()
|
||||
|
||||
detach: ->
|
||||
return unless @hasParent()
|
||||
return unless @isOnDom()
|
||||
|
||||
@detaching = true
|
||||
@miniEditor.setText('')
|
||||
@previouslyFocusedElement?.focus()
|
||||
|
||||
super
|
||||
|
||||
@detaching = false
|
||||
|
||||
confirm: ->
|
||||
lineNumber = @miniEditor.getText()
|
||||
editor = rootView.getActiveView()
|
||||
|
||||
Reference in New Issue
Block a user