mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
hookup expand-collapse
This commit is contained in:
@@ -46,6 +46,9 @@ class CommandPanelView extends View
|
||||
rootView.command 'command-panel:repeat-relative-address-in-reverse', => @repeatRelativeAddressInReverse()
|
||||
rootView.command 'command-panel:set-selection-as-regex-address', => @setSelectionAsLastRelativeAddress()
|
||||
|
||||
@on 'click', '.expand', @onExpandAll
|
||||
@on 'click', '.collapse', @onCollapseAll
|
||||
|
||||
@previewList.hide()
|
||||
@previewCount.hide()
|
||||
@errorMessages.hide()
|
||||
@@ -93,6 +96,12 @@ class CommandPanelView extends View
|
||||
@loadingMessage.html 'Searching...'
|
||||
@loadingMessage.show()
|
||||
|
||||
onExpandAll: (event) =>
|
||||
@previewList.expandAllPaths()
|
||||
|
||||
onCollapseAll: (event) =>
|
||||
@previewList.collapseAllPaths()
|
||||
|
||||
attach: (text='', options={}) ->
|
||||
@errorMessages.hide()
|
||||
|
||||
@@ -118,6 +127,7 @@ class CommandPanelView extends View
|
||||
try
|
||||
@commandInterpreter.eval(command, rootView.getActiveEditSession()).done ({operationsToPreview, errorMessages}) =>
|
||||
@toggleLoading()
|
||||
@expandCollapse.show()
|
||||
@history.push(command)
|
||||
@historyIndex = @history.length
|
||||
|
||||
|
||||
@@ -31,6 +31,14 @@ class PreviewList extends ScrollView
|
||||
e.children('ul.matches').toggle 100, (e) ->
|
||||
$(this).closest('li.path').toggleClass 'is-collapsed'
|
||||
|
||||
expandAllPaths: ->
|
||||
@find('ul.matches').show()
|
||||
@find('.path').removeClass 'is-collapsed'
|
||||
|
||||
collapseAllPaths: ->
|
||||
@find('ul.matches').hide()
|
||||
@find('.path').addClass 'is-collapsed'
|
||||
|
||||
destroy: ->
|
||||
@destroyOperations() if @operations
|
||||
|
||||
|
||||
Reference in New Issue
Block a user