Use presenter to render highlights

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Nathan Sobo
2015-01-23 17:48:27 -07:00
parent 2f526c59c5
commit 8ebd057b0c
6 changed files with 95 additions and 94 deletions

View File

@@ -12,13 +12,10 @@ HighlightsComponent = React.createClass
@renderHighlights() if @props.performedInitialMeasurement
renderHighlights: ->
{editor, highlightDecorations, lineHeightInPixels} = @props
{editor, presenter} = @props
highlightComponents = []
for markerId, {startPixelPosition, endPixelPosition, decorations} of highlightDecorations
for decoration in decorations
highlightComponents.push(HighlightComponent({editor, key: "#{markerId}-#{decoration.id}", startPixelPosition, endPixelPosition, decoration, lineHeightInPixels}))
for key, state of presenter.state.content.highlights
highlightComponents.push(HighlightComponent({editor, key, state}))
highlightComponents
componentDidMount: ->