Can trigger an event by clicking it in the list

This commit is contained in:
Nathan Sobo
2012-10-02 16:59:08 -10:00
parent 0ecdabb023
commit 389552c057
2 changed files with 31 additions and 9 deletions

View File

@@ -19,6 +19,8 @@ class EventPalette extends View
@on 'move-down', => @selectNext()
@on 'event-palette:cancel', => @detach()
@on 'event-palette:select', => @triggerSelectedEvent()
@on 'mousedown', '.event', (e) => @selectItem($(e.target).closest('.event'))
@on 'mouseup', '.event', => @triggerSelectedEvent()
attach: ->
@previouslyFocusedElement = $(':focus')
@@ -72,5 +74,5 @@ class EventPalette extends View
@detach()
detach: ->
@rootView.focus() if @is(':focus')
@rootView.focus() if @miniEditor.isFocused
super