mirror of
https://github.com/atom/atom.git
synced 2026-01-25 23:08:18 -05:00
Expand result with right arrow key
This commit is contained in:
@@ -19,3 +19,4 @@
|
||||
|
||||
'.command-panel .preview-list':
|
||||
'left': 'command-panel:collapse-result'
|
||||
'right': 'command-panel:expand-result'
|
||||
|
||||
@@ -18,7 +18,12 @@ class PathView extends View
|
||||
initialize: ({previewList}) ->
|
||||
@on 'mousedown', @onPathSelected
|
||||
previewList.command 'command-panel:collapse-result', =>
|
||||
@collapse(true) if @find('.selected').length
|
||||
@collapse(true) if @isSelected()
|
||||
previewList.command 'command-panel:expand-result', =>
|
||||
@expand(true) if @isSelected()
|
||||
|
||||
isSelected: ->
|
||||
@hasClass('selected') or @find('.selected').length
|
||||
|
||||
onPathSelected: (event) =>
|
||||
e = $(event.target)
|
||||
|
||||
@@ -479,9 +479,11 @@ describe "CommandPanel", ->
|
||||
previewList.find('li.path:first-child').mousedown()
|
||||
expect(previewList.find('li.path:first-child ul.matches')).toBeVisible()
|
||||
|
||||
describe "when command-panel:collapse-result is triggered", ->
|
||||
it "collapses the path of the selected operation", ->
|
||||
describe "when command-panel:collapse-result and command-panel:expand-result are triggered", ->
|
||||
it "collapses and expands the path of the selection", ->
|
||||
rootView.attachToDom()
|
||||
expect(previewList.find('li.path:first-child ul.matches')).toBeVisible()
|
||||
previewList.trigger 'command-panel:collapse-result'
|
||||
expect(previewList.find('li.path:first-child ul.matches')).toBeHidden()
|
||||
previewList.trigger 'command-panel:expand-result'
|
||||
expect(previewList.find('li.path:first-child ul.matches')).toBeVisible()
|
||||
|
||||
Reference in New Issue
Block a user