Trigger editor:will-be-removed from SpacePen shim, not component

By the time the component is getting unmounted, we have already called
remove hooks on the SpacePen shim so subscriptions to the event have
been removed.
This commit is contained in:
Nathan Sobo 2014-11-20 11:13:40 -07:00
parent 616a94a10e
commit b5edefcae8
2 changed files with 1 additions and 1 deletions

View File

@ -199,7 +199,6 @@ TextEditorComponent = React.createClass
componentWillUnmount: ->
{editor, hostElement} = @props
hostElement.__spacePenView.trigger 'editor:will-be-removed', [hostElement.__spacePenView]
@unsubscribe()
@scopedConfigSubscriptions.dispose()
window.removeEventListener 'resize', @requestHeightAndWidthMeasurement

View File

@ -138,6 +138,7 @@ class TextEditorView extends View
beforeRemove: ->
@trigger 'editor:detached', [this]
@trigger 'editor:will-be-removed', [this]
@attached = false
remove: (selector, keepData) ->