mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-21 16:08:24 +03:00
Don't bubble up up/down events triggered on preview list
This commit is contained in:
parent
d13c2c265a
commit
6183680d15
@ -407,6 +407,17 @@ describe "CommandPanel", ->
|
||||
|
||||
_.times previewList.getOperations().length, -> previewList.trigger 'core:move-up'
|
||||
|
||||
it "doesn't bubble up the event and the command panel text doesn't change", ->
|
||||
rootView.attachToDom()
|
||||
commandPanel.miniEditor.setText "command"
|
||||
previewList.focus()
|
||||
previewList.trigger 'core:move-up'
|
||||
expect(previewList.find('li:eq(0)')).toHaveClass 'selected'
|
||||
expect(commandPanel.miniEditor.getText()).toBe 'command'
|
||||
previewList.trigger 'core:move-down'
|
||||
expect(previewList.find('li:eq(1)')).toHaveClass 'selected'
|
||||
expect(commandPanel.miniEditor.getText()).toBe 'command'
|
||||
|
||||
describe "when core:confirm is triggered on the preview list", ->
|
||||
it "opens the operation's buffer, selects and scrolls to the search result, and focuses the active editor", ->
|
||||
rootView.height(200)
|
||||
|
@ -12,8 +12,8 @@ class PreviewList extends ScrollView
|
||||
|
||||
initialize: (@rootView) ->
|
||||
super
|
||||
@on 'core:move-down', => @selectNextOperation()
|
||||
@on 'core:move-up', => @selectPreviousOperation()
|
||||
@on 'core:move-down', => @selectNextOperation(); false
|
||||
@on 'core:move-up', => @selectPreviousOperation(); false
|
||||
@on 'core:confirm', => @executeSelectedOperation()
|
||||
|
||||
@on 'mousedown', 'li', (e) =>
|
||||
|
Loading…
Reference in New Issue
Block a user