Ctrl-enter toggles event palette (hides when showing)

I changed the event name to event-palette:toggle because ctrl-enter
should hide the event palette when it is showing. Previously that
broke, because we would try to re-show the event palette.
This commit is contained in:
Nathan Sobo
2012-10-04 09:44:35 -10:00
parent 66c997f75d
commit a895aa0826
3 changed files with 14 additions and 7 deletions

View File

@@ -8,7 +8,7 @@ class EventPalette extends SelectList
@activate: (rootView) ->
requireStylesheet 'event-palette/event-palette.css'
@instance = new EventPalette(rootView)
rootView.on 'event-palette:show', => @instance.attach()
rootView.on 'event-palette:toggle', => @instance.attach()
@viewClass: ->
"#{super} event-palette"
@@ -16,6 +16,7 @@ class EventPalette extends SelectList
filterKey: 0 # filter on the event name for now
initialize: (@rootView) ->
@on 'event-palette:toggle', => @cancel()
super
attach: ->

View File

@@ -1,6 +1,5 @@
window.keymap.bindKeys 'body'
'ctrl-enter': 'event-palette:show'
window.keymap.bindKeys 'body, .event-palette .editor'
'ctrl-enter': 'event-palette:toggle'
window.keymap.bindKeys '.event-palette .editor'
'enter': 'event-palette:select'
'escape': 'event-palette:cancel'
'ctrl-enter': 'event-palette:toggle'