mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
Construct LinesComponent with visibility param to avoid redundant update
This commit is contained in:
@@ -14,7 +14,7 @@ module.exports =
|
||||
class LinesComponent
|
||||
placeholderTextDiv: null
|
||||
|
||||
constructor: ({@presenter, @hostElement, @useShadowDOM}) ->
|
||||
constructor: ({@presenter, @hostElement, @useShadowDOM, visible}) ->
|
||||
@measuredLines = new Set
|
||||
@lineNodesByLineId = {}
|
||||
@screenRowsByLineId = {}
|
||||
@@ -42,7 +42,7 @@ class LinesComponent
|
||||
else
|
||||
@overlayManager = new OverlayManager(@domNode)
|
||||
|
||||
@updateSync()
|
||||
@updateSync(visible)
|
||||
|
||||
updateSync: (visible) ->
|
||||
@newState = @presenter.state.content
|
||||
|
||||
@@ -116,11 +116,10 @@ TextEditorComponent = React.createClass
|
||||
|
||||
@mountGutterComponent() if @gutterVisible
|
||||
|
||||
@linesComponent = new LinesComponent({@presenter, hostElement, useShadowDOM})
|
||||
scrollViewNode = @refs.scrollView.getDOMNode()
|
||||
horizontalScrollbarNode = @refs.horizontalScrollbar.getDOMNode()
|
||||
@linesComponent = new LinesComponent({@presenter, hostElement, useShadowDOM, visible: @isVisible()})
|
||||
scrollViewNode.insertBefore(@linesComponent.domNode, horizontalScrollbarNode)
|
||||
@linesComponent.updateSync(@isVisible())
|
||||
|
||||
@observeEditor()
|
||||
@listenForDOMEvents()
|
||||
|
||||
Reference in New Issue
Block a user