mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
This allows us to use the presenter for all stages of the component lifecycle rather than needing to wait until it is created. Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
26 lines
805 B
CoffeeScript
26 lines
805 B
CoffeeScript
React = require 'react-atom-fork'
|
|
{div} = require 'reactionary-atom-fork'
|
|
{isEqualForProperties} = require 'underscore-plus'
|
|
HighlightComponent = require './highlight-component'
|
|
|
|
module.exports =
|
|
HighlightsComponent = React.createClass
|
|
displayName: 'HighlightsComponent'
|
|
|
|
render: ->
|
|
div className: 'highlights',
|
|
@renderHighlights()
|
|
|
|
renderHighlights: ->
|
|
{presenter} = @props
|
|
highlightComponents = []
|
|
for key, state of presenter.state.content.highlights
|
|
highlightComponents.push(HighlightComponent({key, state}))
|
|
highlightComponents
|
|
|
|
componentDidMount: ->
|
|
if atom.config.get('editor.useShadowDOM')
|
|
insertionPoint = document.createElement('content')
|
|
insertionPoint.setAttribute('select', '.underlayer')
|
|
@getDOMNode().appendChild(insertionPoint)
|