mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Do a better job imitating the old SpacePen-based editor
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user