mirror of
https://github.com/atom/atom.git
synced 2026-02-10 06:35:00 -05:00
Focus the root view when canceling the move dialog.
This is temporary, because we really want to focus the tree view, but less annoying for now than losing focus entirely.
This commit is contained in:
@@ -6,3 +6,4 @@ window.keymap.bindKeys '.tree-view'
|
||||
|
||||
window.keymap.bindKeys '.move-dialog .mini.editor'
|
||||
'enter': 'tree-view:confirm'
|
||||
'escape': 'tree-view:cancel'
|
||||
|
||||
@@ -163,8 +163,9 @@ class MoveDialog extends View
|
||||
|
||||
initialize: (@project, @path) ->
|
||||
@editor.focus()
|
||||
@editor.on 'focusout', => @remove()
|
||||
@on 'tree-view:confirm', => @confirm()
|
||||
@on 'tree-view:cancel', => @cancel()
|
||||
@editor.on 'focusout', => @remove()
|
||||
|
||||
relativePath = @project.relativize(@path)
|
||||
@editor.setText(relativePath)
|
||||
@@ -175,3 +176,9 @@ class MoveDialog extends View
|
||||
confirm: ->
|
||||
fs.move(@path, @project.resolve(@editor.getText()))
|
||||
@remove()
|
||||
$('#root-view').focus()
|
||||
|
||||
cancel: ->
|
||||
@remove()
|
||||
$('#root-view').focus()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user