Put views appended via appendToLinesView in the light DOM

This adds an insertion point to the lines div via a <content> tag,
allowing immediate children of the editor tag to be positioned relative
to the lines div but still be styled via global CSS.
This commit is contained in:
Nathan Sobo
2014-10-16 17:31:15 -06:00
parent 7202908780
commit ab846a2495
2 changed files with 5 additions and 1 deletions

View File

@@ -57,6 +57,10 @@ LinesComponent = React.createClass
@lineIdsByScreenRow = {}
@renderedDecorationsByLineId = {}
componentDidMount: ->
node = @getDOMNode()
node.appendChild(document.createElement('content'))
shouldComponentUpdate: (newProps) ->
return true unless isEqualForProperties(newProps, @props,
'renderedRowRange', 'lineDecorations', 'highlightDecorations', 'lineHeightInPixels', 'defaultCharWidth',

View File

@@ -169,7 +169,7 @@ class TextEditorView extends View
appendToLinesView: (view) ->
view.css('position', 'absolute')
view.css('z-index', 1)
@find('.lines').prepend(view)
@append(view)
unmountComponent: ->
React.unmountComponentAtNode(@element) if @component.isMounted()