mirror of
https://github.com/atom/atom.git
synced 2026-02-19 02:44:29 -05:00
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:
@@ -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',
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user