mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Don't select operations if path is collapsed
This commit is contained in:
@@ -58,7 +58,10 @@ class PreviewList extends ScrollView
|
||||
selectedView = @find('.selected').view()
|
||||
|
||||
if selectedView instanceof PathView
|
||||
nextView = selectedView.find('.operation:first')
|
||||
if selectedView.hasClass('is-collapsed')
|
||||
nextView = selectedView.next().view()
|
||||
else
|
||||
nextView = selectedView.find('.operation:first')
|
||||
else
|
||||
nextView = selectedView.next().view() ? selectedView.closest('.path').next().view()
|
||||
if nextView?
|
||||
@@ -70,7 +73,8 @@ class PreviewList extends ScrollView
|
||||
selectedView = @find('.selected').view()
|
||||
|
||||
if selectedView instanceof PathView
|
||||
previousView = selectedView.prev().find('.operation:last').view()
|
||||
previousView = selectedView.prev()
|
||||
previousView = previousView.find('.operation:last').view() unless previousView.hasClass('is-collapsed')
|
||||
else
|
||||
previousView = selectedView.prev().view() ? selectedView.closest('.path').view()
|
||||
|
||||
|
||||
@@ -416,6 +416,15 @@ describe "CommandPanel", ->
|
||||
expect(previewList.find('li.operation:eq(0)')).toHaveClass 'selected'
|
||||
expect(commandPanel.miniEditor.getText()).toBe 'command'
|
||||
|
||||
it "doesn't select collapsed operations", ->
|
||||
rootView.attachToDom()
|
||||
previewList.trigger 'command-panel:collapse-result'
|
||||
expect(previewList.find('li.path:eq(0)')).toHaveClass 'selected'
|
||||
previewList.trigger 'core:move-down'
|
||||
expect(previewList.find('li.path:eq(1)')).toHaveClass 'selected'
|
||||
previewList.trigger 'core:move-up'
|
||||
expect(previewList.find('li.path:eq(0)')).toHaveClass 'selected'
|
||||
|
||||
describe "when move-to-top and move-to-bottom are triggered on the preview list", ->
|
||||
it "selects the first path or last operation", ->
|
||||
rootView.attachToDom()
|
||||
|
||||
Reference in New Issue
Block a user