From ab846a24958cfed5140cfb5e4a89cc5637b11856 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 16 Oct 2014 17:31:15 -0600 Subject: [PATCH] Put views appended via appendToLinesView in the light DOM This adds an insertion point to the lines div via a tag, allowing immediate children of the editor tag to be positioned relative to the lines div but still be styled via global CSS. --- src/lines-component.coffee | 4 ++++ src/text-editor-view.coffee | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lines-component.coffee b/src/lines-component.coffee index 865b4b19a..f75df5bc8 100644 --- a/src/lines-component.coffee +++ b/src/lines-component.coffee @@ -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', diff --git a/src/text-editor-view.coffee b/src/text-editor-view.coffee index 84a757a97..7c2963517 100644 --- a/src/text-editor-view.coffee +++ b/src/text-editor-view.coffee @@ -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()