mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 23:48:05 +03:00
Subscribe to editor commands
We need to unsubscribe when the editor is removed! Closes #3651
This commit is contained in:
parent
443df29236
commit
50cf5f3e95
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user