Remove opaque backgrounds on mini editors

Fixes #3239
This commit is contained in:
Ben Ogle
2014-08-12 14:52:59 -07:00
parent a3d72f5e6a
commit 7de2ad34aa
3 changed files with 6 additions and 3 deletions

View File

@@ -2103,6 +2103,9 @@ describe "EditorComponent", ->
it "adds the 'mini' class to the wrapper view", ->
expect(wrapperNode.classList.contains('mini')).toBe true
it "does not have an opaque background on lines", ->
expect(component.refs.lines.getDOMNode().getAttribute('style')).not.toContain 'background-color'
it "does not render invisible characters", ->
component.setInvisibles(eol: 'E')
component.setShowInvisibles(true)

View File

@@ -112,7 +112,7 @@ EditorComponent = React.createClass
@scrollingVertically, scrollHeight, scrollWidth, mouseWheelScreenRow, invisibles,
@visible, scrollViewHeight, @scopedCharacterWidthsChangeCount, lineWidth, @useHardwareAcceleration,
placeholderText, @performedInitialMeasurement, @backgroundColor, cursorPixelRects,
cursorBlinkPeriod, cursorBlinkResumeDelay
cursorBlinkPeriod, cursorBlinkResumeDelay, mini
}
ScrollbarComponent

View File

@@ -22,12 +22,12 @@ LinesComponent = React.createClass
if performedInitialMeasurement
{editor, highlightDecorations, scrollHeight, scrollWidth, placeholderText, backgroundColor} = @props
{lineHeightInPixels, defaultCharWidth, scrollViewHeight, scopedCharacterWidthsChangeCount} = @props
{scrollTop, scrollLeft, cursorPixelRects} = @props
{scrollTop, scrollLeft, cursorPixelRects, mini} = @props
style =
height: Math.max(scrollHeight, scrollViewHeight)
width: scrollWidth
WebkitTransform: @getTransform()
backgroundColor: backgroundColor
backgroundColor: if mini then null else backgroundColor
div {className: 'lines', style},
div className: 'placeholder-text', placeholderText if placeholderText?