Do a better job imitating the old SpacePen-based editor

This commit is contained in:
Nathan Sobo
2014-04-02 20:05:27 -06:00
parent 1b8f23722b
commit 565b611c18

View File

@@ -4,14 +4,20 @@ EditorComponent = require './editor-component'
module.exports =
class ReactEditorView extends View
@content: -> @div class: 'react-wrapper'
@content: -> @div class: 'editor react-wrapper'
constructor: (@editor) ->
super
getEditor: -> @editor
afterAttach: (onDom) ->
return unless onDom
@attached = true
@component = React.renderComponent(EditorComponent({@editor}), @element)
@trigger 'editor:attached', [this]
beforeDetach: ->
React.unmountComponentAtNode(@element)
@attached = false
@trigger 'editor:detached', this