Subscribe to editor commands

We need to unsubscribe when the editor is removed!

Closes #3651
This commit is contained in:
Ben Ogle 2014-09-30 09:33:50 -07:00
parent 443df29236
commit 50cf5f3e95

View File

@ -514,8 +514,8 @@ TextEditorComponent = React.createClass
addCommandListeners: (listenersByCommandName) ->
{parentView} = @props
addListener = (command, listener) ->
parentView.command command, (event) ->
addListener = (command, listener) =>
@subscribe parentView.command command, (event) ->
event.stopPropagation()
listener(event)